home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / editors / elvis17.zoo / doc / Elvisman.txt < prev    next >
Encoding:
Text File  |  1993-09-23  |  183.5 KB  |  5,941 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.   ::      #######                                      ::
  8.   :::     #        #       #    #     #     ####      :::
  9.   ::::    #        #       #    #     #    #         ::::
  10.   :::::   #####    #       #    #     #     ####    :::::
  11.   ::::    #        #       #    #     #         #    ::::
  12.   :::     #        #        #  #      #    #    #     :::
  13.   ::      #######  ######    ##       #     ####       ::
  14.  
  15.                     - a clone of vi/ex -
  16.                         version 1.7
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. Author:  Steve Kirkendall
  48.          14407 SW Teal Blvd., Apt C
  49.          Beaverton, OR 97005
  50.  
  51. E-Mail:  kirkenda@cs.pdx.edu
  52.  
  53. Phone:   (503) 643-6980
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                           09/23/93
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.                      Table of Contents
  77.  
  78.  
  79.  
  80.  
  81. INTRODUCTION What Elvis does, Copyright, How to com-
  82. pile Elvis, Overview ..................................    1
  83.  
  84. VISUAL MODE COMMANDS Normal interactive editing,
  85. Input mode, Arrow keys, Digraphs, Abbreviations,
  86. Auto-indentation ......................................    2
  87.  
  88. COLON MODE COMMANDS Line specifiers, Text entry, Cut
  89. & paste, Display text, Global operations, Line edit-
  90. ing, Undo, Configuration & status, Multiple files,
  91. Switching files, Working with a compiler, Exiting,
  92. File I/O, Directory & shell, Debugging ................    3
  93.  
  94. REGULAR EXPRESSIONS Syntax, Options, Substitutions,
  95. Examples ..............................................    4
  96.  
  97. OPTIONS Autoindent, Autoprint, etc.  ..................    5
  98.  
  99. CUT BUFFERS Putting text into a cut buffer, Pasting
  100. from a cut buffer, Macros, The effect of switching
  101. files .................................................    6
  102.  
  103. DIFFERENCES BETWEEN Elvis AND THE REAL VI/EX Exten-
  104. sions, Omissions ......................................    7
  105.  
  106. INTERNAL For programmers only, The temporary file,
  107. Implementation of editing, Marks and the cursor,
  108. Colon command interpretation, Screen control, Porta-
  109. bility ................................................    8
  110.  
  111. MAKEFILE ..............................................    9
  112.  
  113. CFLAGS ................................................   10
  114.  
  115. TERMCAP ...............................................   11
  116.  
  117. ENVIRONMENT VARIABLES .................................   12
  118.  
  119. VERSIONS ..............................................   13
  120.  
  121. QUESTIONS & ANSWERS ...................................   14
  122.  
  123.  
  124.   UNIX-style "man" pages appear at the end of this manual.
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                           09/23/93
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. 1.  INTRODUCTION
  140.  
  141.      Elvis is a clone of vi/ex, the  standard  UNIX  editor.
  142. Elvis  supports  nearly  all  of the vi/ex commands, in both
  143. visual mode and colon mode.
  144.  
  145.      Like vi/ex, Elvis stores most of the  text  in  a  tem-
  146. porary  file,  instead of RAM.  This allows it to edit files
  147. that are too large to fit in a single process'  data  space.
  148. Also, the edit buffer can survive a power failure or crash.
  149.  
  150.      Elvis runs under BSD UNIX, AT&T SysV UNIX,  Minix,  MS-
  151. DOS,  Atari TOS, Coherent, OS9/68000, VMS and AmigaDos.  The
  152. next version is also expected to add  MS-Windows,  OS/2  and
  153. MacOS.  Contact me before you start porting it to some other
  154. OS, because somebody else may have already done it for you.
  155.  
  156.      Elvis is freely redistributable, in either source  form
  157. or  executable  form.   There are no restrictions on how you
  158. may use it.
  159.  
  160. 1.1.  Compiling
  161.  
  162.      See the "Versions" section of this manual for  instruc-
  163. tions on how to compile Elvis.
  164.  
  165.      If you want to port Elvis to another O.S. or  compiler,
  166. then  you  should start be reading the "Portability" part of
  167. the "Internal" section.
  168.  
  169. 1.2.  Overview of Elvis
  170.  
  171.      The user interface of Elvis/vi/ex is weird.  There  are
  172. two major command modes in Elvis, and a few text input modes
  173. as well.  Each command mode has a command which  allows  you
  174. to switch to the other mode.
  175.  
  176.      You will probably use the visual command mode  most  of
  177. the  time.   This  is the mode that Elvis normally starts up
  178. in.
  179.  
  180.      In visual command mode, the  entire  screen  is  filled
  181. with lines of text from your file.  Each keystroke is inter-
  182. pretted as part of a visual command.  If  you  start  typing
  183. text, it will not be inserted, it will be treated as part of
  184. a command.  To insert text, you must first give  an  "insert
  185. text"  command.   This  will take some getting used to.  (An
  186. alternative exists.  Lookup the "inputmode" option.)
  187.  
  188.      The colon mode is quite different.   Elvis  displays  a
  189. ":" character on the bottom line of the screen, as a prompt.
  190. You are then expected to type in a command line and hit  the
  191. <Return>  key.   The set of commands recognized in the colon
  192. mode is different from visual mode's.
  193.  
  194.  
  195.  
  196.                           09/23/93
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205. 2.  VISUAL MODE COMMANDS
  206.  
  207.      Most visual mode commands are one keystroke long.   The
  208. following  table lists the operation performed by each keys-
  209. troke, and also denotes any options  or  arguments  that  it
  210. accepts.   Notes  at the end of the table describe the nota-
  211. tion used in this table.
  212.  
  213.      In addition to the keys listed  here,  your  keyboard's
  214. "arrow"  keys will be interpretted as the appropriate cursor
  215. movement commands.  The same goes for <PgUp> and <PgDn>,  if
  216. your  keyboard  has  them.   The  <Insert>  key  will toggle
  217. between insert mode and replace mode.  There is a colon mode
  218. command (":map", to be described later) which will allow you
  219. to define other keys, such as function keys.
  220.  
  221.      A tip: visual command mode looks a lot like text  input
  222. mode.   If  you  forget  which  mode you're in, just hit the
  223. <Esc> key.  If Elvis beeps, then you're  in  visual  command
  224. mode.   If Elvis does not beep, then you were in input mode,
  225. but by hitting <Esc> you will have switched to  visual  com-
  226. mand  mode.   So, one way or another, after <Esc> Elvis will
  227. be ready for a command.
  228.  
  229. +2'COMMAND   DESCRIPTION-2'
  230.        ^A    Search for next occurence of word at cursor (MOVE)(EXT)
  231.        ^B    Move toward the top of the file by 1 screenful
  232.        ^C    --- (usually sends SIGINT, to interupt a command)
  233. count  ^D    Scroll down <count> lines (default 1/2 screen)
  234. count  ^E    Scroll up <count> lines
  235.        ^F    Move toward the bottom of the file by 1 screenful
  236.        ^G    Show file status, and the current line #
  237. count  ^H    Move left, like h (MOVE)
  238.        ^I    ---
  239. count  ^J    Move down (MOVE)
  240.        ^K    ---
  241.        ^L    Redraw the screen
  242. count  ^M    Move to the front of the next line (MOVE)
  243. count  ^N    Move down (MOVE)
  244.        ^O    ---
  245. count  ^P    Move up (MOVE)
  246.        ^Q    --- (typically XON, which restarts screen updates)
  247.        ^R    Redraw the screen
  248.        ^S    --- (typically XOFF, which stops screen updates)
  249.        ^T    ---
  250. count  ^U    Scroll up <count> lines (default 1/2 screen)
  251.        ^V    ---
  252.        ^W    ---
  253. count  ^X    Move to a physical column number on the screen (MOVE) (EXT)
  254. count  ^Y    Scroll down <count> lines
  255.        ^Z    --- (sometimes sends SIGSUSP, to suspend execution)
  256.        ESC   ---
  257.        ^\    --- (usually sends SIGQUIT, which is ignored)
  258.        ^]    If the cursor is on a tag name, go to that tag
  259.  
  260.  
  261.  
  262.                           09/23/93
  263.  
  264.  
  265.  
  266.  
  267.  
  268. 2-2                 VISUAL MODE COMMANDS                 2-2
  269.  
  270.  
  271.        ^^    Switch to the previous file, like ":e #"
  272.        ^_    ---
  273. count  SPC   Move right,like l (MOVE)
  274.        ! -2'mv+2'Run the selected lines thru an external filter program
  275.        " -2'key+2'Select which cut buffer to use next
  276. count  # -2'++2'Increment a number (EDIT) (EXT)
  277.        $     Move to the rear of the current line (MOVE)
  278. count  %     Move to matching (){}[] or to a given % of file (MOVE) (EXT)
  279. count  &     Repeat the previous ":s//" command here (EDIT)
  280.        ' -2'key+2'Move to a marked line (MOVE)
  281. count  (     Move backward <count> sentences (MOVE)
  282. count  )     Move forward <count> sentences (MOVE)
  283.        *     Go to the next error in the errlist (EXT)
  284. count  +     Move to the front of the next line (MOVE)
  285. count  ,     Repeat the previous [fFtT] but in the other direction (MOVE)
  286. count  -     Move to the front of the preceding line (MOVE)
  287. count  .     Repeat the previous "edit" command
  288.        / -2'text+2'Search forward for a given regular expression (MOVE)
  289.        0     If not part of count, move to 1st char of this line (MOVE)
  290.        1     Part of count
  291.        2     Part of count
  292.        3     Part of count
  293.        4     Part of count
  294.        5     Part of count
  295.        6     Part of count
  296.        7     Part of count
  297.        8     Part of count
  298.        9     Part of count
  299.        : -2'text+2'Run single EX cmd
  300. count  ;     Repeat the previous [fFtT] cmd (MOVE)
  301.        < -2'mv+2'Shift text left (EDIT)
  302.        = -2'mv+2'Reformat
  303.        > -2'mv+2'Shift text right (EDIT)
  304.        ? -2'text+2'Search backward for a given regular expression (MOVE)
  305.        @ -2'key+2'Execute the contents of a cut-buffer as VI commands
  306. count  A -2'inp+2'Append at end of the line (EDIT)
  307. count  B     Move back Word (MOVE)
  308.        C -2'inp+2'Change text from the cursor through the end of the line (EDIT)
  309.        D     Delete text from the cursor through the end of the line (EDIT)
  310. count  E     Move end of Word (MOVE)
  311. count  F -2'key+2'Move leftward to a given character (MOVE)
  312. count  G     Move to line #<count> (default is the bottom line) (MOVE)
  313. count  H     Move to home row (the line at the top of the screen)
  314. count  I -2'inp+2'Insert at the front of the line (after indents) (EDIT)
  315. count  J     Join lines, to form one big line (EDIT)
  316.        K     Look up keyword (EXT)
  317. count  L     Move to last row (the line at the bottom of the screen)
  318.        M     Move to middle row
  319.        N     Repeat previous search, but in the opposite direction (MOVE)
  320. count  O -2'inp+2'Open up a new line above the current line (EDIT)
  321.        P     Paste text before the cursor (EDIT)
  322.        Q     Quit to EX mode
  323.        R -2'inp+2'Overtype (EDIT)
  324. count  S -2'inp+2'Change lines, like <count>cc
  325.  
  326.  
  327.  
  328.                           09/23/93
  329.  
  330.  
  331.  
  332.  
  333.  
  334. 2-3                 VISUAL MODE COMMANDS                 2-3
  335.  
  336.  
  337. count  T -2'key+2'Move leftward *almost* to a given character (MOVE)
  338.        U     Undo all recent changes to the current line
  339.        V     Start marking lines for c/d/y/</>/!/\ (EXT)
  340. count  W     Move forward <count> Words (MOVE)
  341. count  X     Delete the character(s) to the left of the cursor (EDIT)
  342. count  Y     Yank text line(s) (copy them into a cut buffer)
  343.        Z Z   Save the file & exit
  344.        [ [   Move back 1 section (MOVE)
  345.        \ -2'mv+2'Pop-up menu for modifying text (EXT)
  346.        ] ]   Move forward 1 section (MOVE)
  347.        ^     Move to the front of the current line (after indent) (MOVE)
  348. count  _     Move to the current line
  349.        ` -2'key+2'Move to a marked character (MOVE)
  350. count  a -2'inp+2'Insert text after the cursor (EDIT)
  351. count  b     Move back <count> words (MOVE)
  352.        c -2'mv+2'Change text (EDIT)
  353.        d -2'mv+2'Delete text (EDIT)
  354. count  e     Move forward to the end of the current word (MOVE)
  355. count  f -2'key+2'Move rightward to a given character (MOVE)
  356.        g     ---
  357. count  h     Move left (MOVE)
  358. count  i -2'inp+2'Insert text at the cursor (EDIT)
  359. count  j     Move down (MOVE)
  360. count  k     Move up (MOVE)
  361. count  l     Move right (MOVE)
  362.        m -2'key+2'Mark a line or character
  363.        n     Repeat the previous search (MOVE)
  364. count  o -2'inp+2'Open a new line below the current line (EDIT)
  365.        p     Paste text after the cursor (EDIT)
  366.        q     ---
  367. count  r -2'key+2'Replace <count> chars by a given character (EDIT)
  368. count  s -2'inp+2'Replace <count> chars with text from the user (EDIT)
  369. count  t -2'key+2'Move rightward *almost* to a given character (MOVE)
  370.        u     Undo the previous edit command
  371.        v     Start marking characters for c/d/y/</>/!/\ (EXT)
  372. count  w     Move forward <count> words (MOVE)
  373. count  x     Delete the character that the cursor's on (EDIT)
  374.        y -2'mv+2'Yank text (copy it into a cut buffer)
  375.        z -2'key+2'Scroll current line to the screen's +=top -=bottom .=middle
  376. count  {     Move back <count> paragraphs (MOVE)
  377. count  |     Move to column <count> (the leftmost column is 1)
  378. count  }     Move forward <count> paragraphs (MOVE)
  379. count  ~     Switch a character between uppercase & lowercase (EDIT)
  380.        DEL   --- (usually mapped to shift-X, so it deletes one character)
  381.  
  382.  
  383. count  Many commands may be preceded by a count.  This is  a
  384.        sequence  of  digits  representing  a decimal number.
  385.        For most commands that use a count,  the  command  is
  386.        repeated   <count>   times.    The  count  is  always
  387.        optional, and usually defaults to 1.
  388.  
  389. key    Some commands require two keystrokes.  The first  key
  390.        always  determines  which  command is to be executed.
  391.  
  392.  
  393.  
  394.                           09/23/93
  395.  
  396.  
  397.  
  398.  
  399.  
  400. 2-4                 VISUAL MODE COMMANDS                 2-4
  401.  
  402.  
  403.        The second key is used as a parameter to the command.
  404.  
  405. mv     Some commands (! < > c d  y  \  =)  operate  on  text
  406.        between  the  cursor  and some other position.  There
  407.        are three ways that  you  can  specifify  that  other
  408.        position.
  409.  
  410.        The first way is to follow the command keystroke with
  411.        a movement command.  For example, "dw" deletes a sin-
  412.        gle word.  "d3w" and "3dw" both delete three words.
  413.  
  414.        The second way  is  to  type  the  command  keystroke
  415.        twice.   This  causes  whole  lines to be acted upon.
  416.        For example, ">>" indents the  current  line.   "3>>"
  417.        indents the current line and the following two lines.
  418.  
  419.        The last way is to move the cursor to one end of  the
  420.        text, type 'v' or 'V' to start marking, move the cur-
  421.        sor to the other end, and then type the desired  com-
  422.        mand key.
  423.  
  424. inp    Many commands allow the user to  interactively  enter
  425.        text.  See the discussion of "input mode" in the fol-
  426.        lowing section.
  427.  
  428. (EXT)  These commands are extensions -- the real vi  doesn't
  429.        have them.
  430.  
  431. (EDIT) These commands affect text, and may  be  repeated  by
  432.        the "." command.
  433.  
  434. (MOVE) These commands move the cursor, and may  be  used  to
  435.        specify  the  extent of a member of the "mv" class of
  436.        commands.
  437.  
  438. 2.1.  Input Mode
  439.  
  440.      You can't type text into your file directly from visual
  441. command  mode.  Instead, you must first give a command which
  442. will put you into input mode.  The commands to do  this  are
  443. A/C/I/O/R/S/a/i/o/s.
  444.  
  445.      The S/s/C/c commands temporarily place a $ at  the  end
  446. of the text that they are going to change.
  447.  
  448.      In input mode, all keystrokes  are  inserted  into  the
  449. text at the cursor's position, except for the following:
  450.  
  451.         ^A      insert a copy of the last input text
  452.         ^D      delete one indent character
  453.         ^H      (backspace) erase the character before the cursor
  454.         ^L      redraw the screen
  455.         ^M      (carriage return) insert a newline (^J, linefeed)
  456.         ^O      execute next key as a visual command (limited!)
  457.  
  458.  
  459.  
  460.                           09/23/93
  461.  
  462.  
  463.  
  464.  
  465.  
  466. 2-5                 VISUAL MODE COMMANDS                 2-5
  467.  
  468.  
  469.         ^P      insert the contents of the cut buffer
  470.         ^R      redraw the screen, like ^L
  471.         ^T      insert an indent character
  472.         ^U      backspace to the beginning of the line
  473.         ^V      insert the following keystroke, even if special
  474.         ^W      backspace to the beginning of the current word
  475.         ^Z^Z    write the file & exit Elvis
  476.         ^[      (ESCape) exit from input mode, back to command mode
  477.  
  478.  
  479.      Also, on some systems, ^S may stop output, ^Q may  res-
  480. tart  output,  and  ^C  may interupt execution.  ^@ (the NUL
  481. character) cannot be inserted.
  482.  
  483.      The R visual command puts you in overtype  mode,  which
  484. is  a  slightly  different  form of input mode.  In overtype
  485. mode, each time you insert a character, one of the old char-
  486. acters is deleted from the file.
  487.  
  488. 2.2.  Arrow keys in Input Mode
  489.  
  490.      The arrow keys can be used to move the cursor in  input
  491. mode.   (This  is  an extension; the real Vi doesn't support
  492. arrow keys in input mode.)  The <PgUp>, <PgDn>, <Home>,  and
  493. <End>  keys  work  in  input  mode,  too.   The <Delete> key
  494. deletes a single character in input mode.  The <Insert>  key
  495. toggles between input mode and replace mode.
  496.  
  497.      The best thing about allowing arrow  keys  to  work  in
  498. input  mode  is  that as long as you're in input mode, Elvis
  499. seems to have a fairly ordinary user interface.   With  most
  500. other  text editors, you are always in either insert mode or
  501. replace mode, and you can use the arrow keys at any time  to
  502. move  the  cursor.   Now,  Elvis can act like that, too.  In
  503. fact, with the new "inputmode"  option  and  the  "control-Z
  504. control-Z"  input  command,  you  may  never have to go into
  505. visual command mode for simple edit sessions.
  506.  
  507. 2.3.  Digraphs
  508.  
  509.      Elvis supports digraphs as a  way  to  enter  non-ASCII
  510. characters.   A  digraph is a character which is composed of
  511. two other characters.  For example, an  apostrophe  and  the
  512. letter i could be defined as a digraph which is to be stored
  513. & displayed as an accented i.
  514.  
  515.      There is no single standard for extended ASCII  charac-
  516. ter  sets.   Elvis  can be compiled to fill the digraph with
  517. values appropriate for either the IBM PC character  set,  or
  518. the  LATIN-1  character  set  used by X windows, or neither.
  519. (See the discussions of -DCS_IBMPC and  -DCS_LATIN1  in  the
  520. CFLAGS  section  of  this manual.)  You can view or edit the
  521. digraph table via the ":digraph" colon command.
  522.  
  523.  
  524.  
  525.  
  526.                           09/23/93
  527.  
  528.  
  529.  
  530.  
  531.  
  532. 2-6                 VISUAL MODE COMMANDS                 2-6
  533.  
  534.  
  535.      Digraphs will not be recognized  until  you've  entered
  536. ":set digraph".
  537.  
  538.      To actually use a digraph  type  the  first  character,
  539. then  hit  <Backspace>,  and then type the second character.
  540. Elvis will then substitute the non-ASCII character in  their
  541. place.
  542.  
  543. 2.4.  Abbreviations
  544.  
  545.      Elvis can expand abbreviations for you.  You define  an
  546. abbreviation  with  the :abbr command, and then whenever you
  547. type in the abbreviated form while in input mode, Elvis will
  548. immediately  replace  it with the long form.  COBOL program-
  549. mers should find this useful. :-)
  550.  
  551.      Elvis doesn't perform the substitution until you type a
  552. non-alphanumeric  character to mark the end of the word.  If
  553. you type a control-V before that non-alphanumeric character,
  554. then Elvis will not perform the substitution.
  555.  
  556. 2.5.  Auto-Indent
  557.  
  558.      With the ":set autoindent" option turned on, Elvis will
  559. automatically  insert leading whitespace at the beginning of
  560. each new line that you type in.  The leading  whitespace  is
  561. copied from the preceding line.
  562.  
  563.      To add more leading  whitespace,  type  control-T.   To
  564. remove some whitespace, type control-D.
  565.  
  566.      If you ":set noautotab", then the whitespace  generated
  567. by  control-T  will  always consist of spaces -- never tabs.
  568. Some people seem to prefer this.
  569.  
  570.      Elvis' autoindent mode isn't 100% compatible with vi's.
  571. In  Elvis, 0^D and ^^D don't work, ^U can wipeout all inden-
  572. tation, and sometimes Elvis will use a different  amount  of
  573. indentation than vi would.
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.                           09/23/93
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601. 3.  COLON MODE COMMANDS
  602.  
  603.         +2'LINES            COMMAND   ARGUMENTS-2'
  604.                             ab[br]    [short] [expanded form]
  605.         -2'[line]+2'        a[ppend][!]
  606.                             ar[gs]    [files]
  607.                             cc        [files]
  608.                             cd[!]     [directory]
  609.         -2'[line][,line]+2' c[hange]
  610.                             chd[ir][!][directory]
  611.         -2'[line][,line]+2' co[py]    line
  612.                             col[or]   [when] [[light] color] [on color]
  613.         -2'[line][,line]+2' d[elete]  [x]
  614.                             dig[raph][!][XX [Y]]
  615.                             e[dit][!] [file]
  616.                             er[rlist][!][errlist]
  617.                             f[ile]    [file]
  618.         -2'[line][,line]+2' g[lobal]  /regexp/ command
  619.         -2'[line]+2'        i[nsert]
  620.         -2'[line][,line]+2' j[oin][!]
  621.         -2'[line][,line]+2' l[ist]
  622.                             mak[e]    [target]
  623.                             map[!]    key mapped_to
  624.         -2'[line]+2'        ma[rk]    x
  625.                             mk[exrc]
  626.         -2'[line][,line]+2' m[ove]    line
  627.                             n[ext][!] [files]
  628.                             N[ext][!]
  629.         -2'[line][,line]+2' nu[mber]
  630.         -2'[line][,line]+2' p[rint]
  631.         -2'[line]+2'        pu[t]     [x]
  632.                             q[uit][!]
  633.         -2'[line]+2'        r[ead]    file
  634.                             rew[ind][!]
  635.                             se[t]     [options]
  636.                             so[urce]  file
  637.         -2'[line][,line]+2' s[ubstitute]/regexp/replacement/[p][g][c]
  638.                             ta[g][!]  tagname
  639.                             una[bbr]  [short]
  640.                             u[ndo]
  641.                             unm[ap][!]key
  642.                             ve[rsion]
  643.         -2'[line][,line]+2' v[global] /regexp/ command
  644.                             vi[sual]  [filename]
  645.                             wq
  646.         -2'[line][,line]+2' w[rite][!][[>>]file]
  647.                             x[it][!]
  648.         -2'[line][,line]+2' y[ank]    [x]
  649.         -2'[line][,line]+2' !         command
  650.         -2'[line][,line]+2' <
  651.         -2'[line][,line]+2' =
  652.         -2'[line][,line]+2' >
  653.         -2'[line][,line]+2' &
  654.                             @          x
  655.  
  656.  
  657.  
  658.                           09/23/93
  659.  
  660.  
  661.  
  662.  
  663.  
  664. 3-2                 COLON MODE COMMANDS                  3-2
  665.  
  666.  
  667.      To use colon mode commands, you must switch from visual
  668. command  mode  to  colon command mode.  The visual mode com-
  669. mands to do this are ":" for a single colon command, or  "Q"
  670. for many colon mode commands.
  671.  
  672. 3.1.  Line Specifiers
  673.  
  674.      Line specifiers are always optional.   The  first  line
  675. specifier  of  most commands usually defaults to the current
  676. line.  The second line specifier usually defaults to be  the
  677. same  as  the  first line specifier.  Exceptions are :write,
  678. :global, and :vglobal, which act on all lines of the file by
  679. default, and :!, which acts on no lines by default.
  680.  
  681.      Line specifiers consist of an absolute part and a rela-
  682. tive  part.   The  absolute  part of a line specifier may be
  683. either an explicit line number, a mark, a dot to denote  the
  684. current  line,  a dollar sign to denote the last line of the
  685. file, or a forward or backward search.
  686.  
  687.      An explicit line number is  simply  a  decimal  number,
  688. expressed as a string of digits.
  689.  
  690.      A mark is typed in  as  an  apostrophe  followed  by  a
  691. letter.  Marks must be set before they can be used.  You can
  692. set a mark in visual  command  mode  by  typing  "m"  and  a
  693. letter,  or  you  can  set  it in colon command mode via the
  694. "mark" command.
  695.  
  696.      A forward search is typed in as  a  regular  expression
  697. surrounded  by  slash  characters;  searching  begins at the
  698. default line.  A backward search is typed in  as  a  regular
  699. expression surrounded by question marks; searching begins at
  700. the line before the default line.
  701.  
  702.      If you omit the absolute part, then the default line is
  703. used.
  704.  
  705.      The relative part of a line specifier is typed as a "+"
  706. or  "-"  character followed by a decimal number.  The number
  707. is added to or subtracted from the absolute part of the line
  708. specifier to produce the final line number.
  709.  
  710.      As a special case, the  %  character  may  be  used  to
  711. specify  all lines of the file.  It is roughly equivelent to
  712. saying 1,$.  This can be a handy shortcut.
  713.  
  714.      Some examples:
  715.  
  716.      :p           print the current line
  717.      :37p         print line 37
  718.      :'gp         print the line which contains mark g
  719.      :/foo/p      print the next line that contains "foo"
  720.      :$p          print the last line of the file
  721.  
  722.  
  723.  
  724.                           09/23/93
  725.  
  726.  
  727.  
  728.  
  729.  
  730. 3-3                 COLON MODE COMMANDS                  3-3
  731.  
  732.  
  733.      :20,30p      print lines 20 through 30
  734.      :1,$p        print all lines of the file
  735.      :%p          print all lines of the file
  736.      :/foo/-2,+4p print 5 lines around the next "foo"
  737.  
  738.  
  739. 3.2.  Text Entry Commands
  740.  
  741.         [line] append
  742.         [line][,line] change ["x]
  743.         [line] insert
  744.  
  745.  
  746.      The append command inserts  text  after  the  specified
  747. line.
  748.  
  749.      The insert command inserts text  before  the  specified
  750. line.
  751.  
  752.      The change command copies the range of lines into a cut
  753. buffer,  deletes  them,  and  inserts new text where the old
  754. text used to be.
  755.  
  756.      For all of these commands, you indicate the end of  the
  757. text  you're  inserting  by hitting ^D or by entering a line
  758. which contains only a period.
  759.  
  760. 3.3.  Cut & Paste Commands
  761.  
  762.         [line][,line] delete ["x]
  763.         [line][,line] yank ["x]
  764.         [line] put ["x]
  765.         [line][,line] copy line
  766.         [line][,line] to line
  767.         [line][,line] move line
  768.  
  769.  
  770.      The delete command copies the specified range of  lines
  771. into a cut buffer, and then deletes them.
  772.  
  773.      The yank command copies the specified  range  of  lines
  774. into a cut buffer, but does *not* delete them.
  775.  
  776.      The put command inserts text from a  cut  buffer  after
  777. the specified line.
  778.  
  779.      The copy and to commands yank the  specified  range  of
  780. lines and then immediately paste them after some other line.
  781.  
  782.      The move command deletes the specified range  of  lines
  783. and  then immediately pastes them after some other line.  If
  784. the destination line comes after the deleted text,  then  it
  785. will  be  adjusted  automatically to account for the deleted
  786. lines.
  787.  
  788.  
  789.  
  790.                           09/23/93
  791.  
  792.  
  793.  
  794.  
  795.  
  796. 3-4                 COLON MODE COMMANDS                  3-4
  797.  
  798.  
  799. 3.4.  Display Text Commands
  800.  
  801.         [line][,line] print
  802.         [line][,line] list
  803.         [line][,line] number
  804.  
  805.  
  806.      The print  command  displays  the  specified  range  of
  807. lines.
  808.  
  809.      The  number  command  displays  the  lines,  with  line
  810. numbers.
  811.  
  812.      The list command also displays them, but it is  careful
  813. to make control characters visible.
  814.  
  815. 3.5.  Global Operations Commands
  816.  
  817.         [line][,line] global /regexp/ command
  818.         [line][,line] vglobal /regexp/ command
  819.  
  820.  
  821.      The global command searches through the  lines  of  the
  822. specified  range  (or  through the whole file if no range is
  823. specified) for lines that contain a  given  regular  expres-
  824. sion.   It  then moves the cursor to each of these lines and
  825. runs some other command on them.
  826.  
  827.      The vglobal command is similar,  but  it  searches  for
  828. lines that don't contain the regular expression.
  829.  
  830. 3.6.  Line Editing Commands
  831.  
  832.         [line][,line] join[!]
  833.         [line][,line] ! program
  834.         [line][,line] <
  835.         [line][,line] >
  836.         [line][,line] substitute /regexp/replacement/[p][g][c]
  837.         [line][,line] &
  838.  
  839.  
  840.      The join command catenates all lines in  the  specified
  841. range  together to form one big line.  If only a single line
  842. is specified, then the following line is catenated onto  it.
  843. The  normal  ":join"  inserts  one or two spaces between the
  844. lines; the ":join!" variation (with a  '!')  doesn't  insert
  845. spaces.
  846.  
  847.      The ! command runs  an  external  filter  program,  and
  848. feeds the specified range of lines to it's stdin.  The lines
  849. are then replaced by the output of the  filter.   A  typical
  850. example would be ":'a,'z!sort" to sort the lines 'a,'z.
  851.  
  852.      The < and > commands shift the specified range of lines
  853.  
  854.  
  855.  
  856.                           09/23/93
  857.  
  858.  
  859.  
  860.  
  861.  
  862. 3-5                 COLON MODE COMMANDS                  3-5
  863.  
  864.  
  865. left  or  right,  normally  by the width of 1 tab character.
  866. The "shiftwidth" option determines the shifting amount.
  867.  
  868.      The substitute command finds the regular expression  in
  869. each  line,  and replaces it with the replacement text.  The
  870. "p" option causes the altered lines to be printed.  The  "g"
  871. option permits all instances of the regular expression to be
  872. found & replaced.  (Without "g", only the  first  occurrence
  873. in  each line is replaced.)  The "c" option asks for confir-
  874. mation before each substitution.
  875.  
  876.      The & command repeats the  previous  substitution  com-
  877. mand.   Actually, "&" is equivelent to "s//~/" with the same
  878. options as last time.  It  searches  for  the  last  regular
  879. expression  that you specified for any purpose, and replaces
  880. it with the the same text that was used in the previous sub-
  881. stitution.
  882.  
  883. 3.7.  Undo Command
  884.  
  885.         undo
  886.  
  887.  
  888.      The undo command restores the file to the state it  was
  889. in before your most recent command which changed text.
  890.  
  891. 3.8.  Configuration & Status Commands
  892.  
  893.         map[!] [key mapped_to]
  894.         unmap[!] key
  895.         abbr [word expanded_form_of_word]
  896.         unabbr word
  897.         digraph[!] [XX [Y]]
  898.         set [options]
  899.         mkexrc
  900.         [line] mark "x
  901.         visual
  902.         version
  903.         [line][,line] =
  904.         file [file]
  905.         source file
  906.         @ "x
  907.         color [when] [["light"] color] ["on" color]
  908.  
  909.  
  910.      The map command allows you to configure Elvis to recog-
  911. nize  your  function  keys,  and  treat  them as though they
  912. transmitted some other  sequence  of  characters.   Normally
  913. this  mapping  is done only when in the visual command mode,
  914. but with the [!] present it will map keys  under  input  and
  915. replace  modes  as well.  When this command is given with no
  916. arguments, it prints a table showing all mappings  currently
  917. in effect.  When called with two arguments, the first is the
  918. sequence that your function key really sends, and the second
  919.  
  920.  
  921.  
  922.                           09/23/93
  923.  
  924.  
  925.  
  926.  
  927.  
  928. 3-6                 COLON MODE COMMANDS                  3-6
  929.  
  930.  
  931. is  the  sequence  that you want Elvis to treat it as having
  932. sent.  As a special case, if the first argument is a  number
  933. then  Elvis  will  map  the  corresponding function key; for
  934. example, ":map 7 dd" will cause the <F7>  key  to  delete  a
  935. line.
  936.  
  937.      The unmap command removes  key  definitions  that  were
  938. made via the map command.
  939.  
  940.      The abbr command is used  to  define/list  a  table  of
  941. abbreviations.  The table contains both the abbreviated form
  942. and the fully spelled-out form.  When you're in visual input
  943. mode,  and  you  type  in  the  abbreviated form, Elvis will
  944. replace the abbreviated  form  with  the  fully  spelled-out
  945. form.   When  this  command  is called without arguments, it
  946. lists the table; with two or more arguments, the first argu-
  947. ment  is  taken as the abbreviated form, and the rest of the
  948. command line is the fully-spelled out form.
  949.  
  950.      The unabbr command deletes entries from the abbr table.
  951.  
  952.      The digraph command allows you to display  the  set  of
  953. digraphs  that  Elvis is using, or add/remove a digraph.  To
  954. list the set of digraphs, use the digraph  command  with  no
  955. arguments.   To  add  a digraph, you should give the digraph
  956. command two arguments.  The first argument is the two  ASCII
  957. characters  that  are to be combined; the second is the non-
  958. ASCII  character  that  they   represent.    The   non-ASCII
  959. character's most significant bit is automatically set by the
  960. digraph command, unless to append a ! to the  command  name.
  961. Removal  of a digraph is similar to adding a digraph, except
  962. that you should leave off the second argument.
  963.  
  964.      The set command  allows  you  examine  or  set  various
  965. options.   With  no  arguments,  it  displays  the values of
  966. options that have been changed.  With  the  single  argument
  967. "all"  it  displays the values of all options, regardless of
  968. whether they've been explicitly set or not.  Otherwise,  the
  969. arguments are treated as options to be set.
  970.  
  971.      The mkexrc command saves the current configuration to a
  972. file called ".exrc" in the current directory.
  973.  
  974.      The mark command defines a named mark  to  refer  to  a
  975. specific  place in the file.  This mark may be used later to
  976. specify lines for other commands.
  977.  
  978.      The visual command puts the editor  into  visual  mode.
  979. Instead of emulating ex, Elvis will start emulating vi.
  980.  
  981.      The version command tells  you  that  what  version  of
  982. Elvis this is.
  983.  
  984.      The = command tells you what line you specified, or, if
  985.  
  986.  
  987.  
  988.                           09/23/93
  989.  
  990.  
  991.  
  992.  
  993.  
  994. 3-7                 COLON MODE COMMANDS                  3-7
  995.  
  996.  
  997. you  specified  a range of lines, it will tell you both end-
  998. points and the number of lines included in the range.
  999.  
  1000.      The file command  tells  you  the  name  of  the  file,
  1001. whether  it  has  been  modified, the number of lines in the
  1002. file, and the current line number.  You can also use  it  to
  1003. change the name of the current file.
  1004.  
  1005.      The source command reads a sequence of colon mode  com-
  1006. mands from a file, and interprets them.
  1007.  
  1008.      The @ command executes the contents of a cut-buffer  as
  1009. EX commands.
  1010.  
  1011.      The color command only works under MS-DOS,  or  if  you
  1012. have  an  ANSI-compatible  color terminal.  It allows you to
  1013. set the foreground and background colors for different types
  1014. of text:  normal, bold, italic, underlined, standout, pop-up
  1015. menu, and visible selection.  By  default,  it  changes  the
  1016. "normal"  colors; to change other colors, the first argument
  1017. to the :color command should be the first letter of the type
  1018. of  text  you want.  The syntax for the colors themselves is
  1019. fairly intuitive.  For example, ":color light cyan on  blue"
  1020. causes  normal  text to be displayed in light cyan on a blue
  1021. background, and ":color b bright white" causes bold text  to
  1022. be  displayed  in  bright  white  on a blue background.  The
  1023. background color always defaults to the  current  background
  1024. color  of  normal  text.   Your  first  :color  command must
  1025. specify both the foreground and background for normal text.
  1026.  
  1027. 3.9.  Multiple File Commands
  1028.  
  1029.         args [files]
  1030.         next[!] [files]
  1031.         Next[!]
  1032.         previous[!]
  1033.         rewind[!]
  1034.  
  1035.  
  1036.      When you invoke Elvis from your shell's  command  line,
  1037. any filenames that you give to Elvis as arguments are stored
  1038. in the args list.  The args command will display this  list,
  1039. or define a new one.
  1040.  
  1041.      The next command switches from the current file to  the
  1042. next  one in the args list.  You may specify a new args list
  1043. here, too.
  1044.  
  1045.      The Next and previous commands (they're really  aliases
  1046. for  the  same  command) switch from the current file to the
  1047. preceding file in the args list.
  1048.  
  1049.      The rewind command switches from the  current  file  to
  1050. the first file in the args list.
  1051.  
  1052.  
  1053.  
  1054.                           09/23/93
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. 3-8                 COLON MODE COMMANDS                  3-8
  1061.  
  1062.  
  1063. 3.10.  Switching Files
  1064.  
  1065.         edit[!] [file]
  1066.         tag[!] tagname
  1067.  
  1068.  
  1069.      The edit command allows to switch from the current file
  1070. to  some  other  file.  This has nothing to do with the args
  1071. list, by the way.
  1072.  
  1073.      The tag command looks up a  given  tagname  in  a  file
  1074. called  "tags".  This tells it which file the tag is in, and
  1075. how to find it in that file.  Elvis  then  switches  to  the
  1076. tag's file and finds the tag.
  1077.  
  1078. 3.11.  Working with a Compiler
  1079.  
  1080.         cc [files]
  1081.         make [target]
  1082.         errlist[!] [errlist]
  1083.  
  1084.  
  1085.      The cc and  make  commands  execute  your  compiler  or
  1086. "make"  utility  and redirect any error messages into a file
  1087. called "errlist".  By default, cc  is  run  on  the  current
  1088. file.   (You  should  write it before running cc.)  The con-
  1089. tents of the "errlist" file are then scanned for error  mes-
  1090. sages.   If  an  error  message is found, then the cursor is
  1091. moved to the line where the  error  was  detected,  and  the
  1092. description of the error is displayed on the status line.
  1093.  
  1094.      After you've fixed one error, the errlist command  will
  1095. move  the cursor to the next error.  In visual command mode,
  1096. hitting `*' will do this, too.
  1097.  
  1098.      You can also create an "errlist" file from  outside  of
  1099. Elvis, and use "elvis -m" to start Elvis and have the cursor
  1100. moved to the first error.  Note that you don't need to  sup-
  1101. ply  a  filename  with "elvis -m" because the error messages
  1102. always say which source file an error is in.
  1103.  
  1104.      Note:  When you use errlist repeatedly to  fix  several
  1105. errors  in  a  single  file,  it  will attempt to adjust the
  1106. reported line numbers to  allow  for  lines  that  you  have
  1107. inserted  or  deleted.   These adjustments are made with the
  1108. assumption that you will  work  though  the  file  from  the
  1109. beginning to the end.
  1110.  
  1111. 3.12.  Exit Commands
  1112.  
  1113.         quit[!]
  1114.         wq
  1115.         xit
  1116.  
  1117.  
  1118.  
  1119.  
  1120.                           09/23/93
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. 3-9                 COLON MODE COMMANDS                  3-9
  1127.  
  1128.  
  1129.      The quit command exits from the editor  without  saving
  1130. your file.
  1131.  
  1132.      The wq command writes your file out, then then exits.
  1133.  
  1134.      The xit command is similar to the  wq  command,  except
  1135. that  xit  won't  bother  to  write your file if you haven't
  1136. modified it.
  1137.  
  1138. 3.13.  File I/O Commands
  1139.  
  1140.         [line] read file
  1141.         [line][,line] write[!] [[>>]file]
  1142.  
  1143.  
  1144.      The read  command  gets  text  from  another  file  and
  1145. inserts  it  after the specified line.  It can also read the
  1146. output of a program; simply precede the program  name  by  a
  1147. '!' and use it in place of the file name.
  1148.  
  1149.      The write command writes the whole file, or  just  part
  1150. of  it,  to some other file.  The !, if present, will permit
  1151. the lines to be written even  if  you've  set  the  readonly
  1152. option.   If  you  precede the filename by >> then the lines
  1153. will be appended to the file.  You can send the lines to the
  1154. standard input of a program by replacing the filename with a
  1155. '!' followed by the command and its arguments.
  1156.  
  1157.      Note: Be careful not to confuse ":w!filename"  and  ":w
  1158. !command".   To  write  to a program, you must have at least
  1159. one blank before the '!'.
  1160.  
  1161. 3.14.  Directory Commands
  1162.  
  1163.         cd [directory]
  1164.         chdir [directory]
  1165.         shell
  1166.  
  1167.  
  1168.      The cd and chdir commands (really  two  names  for  one
  1169. command) switch the current working directory.
  1170.  
  1171.      The shell command starts an interactive shell.
  1172.  
  1173. 3.15.  Debugging Commands
  1174.  
  1175.         [line][,line] debug[!]
  1176.         validate[!]
  1177.  
  1178.  
  1179.      These commands are only available if you compile  Elvis
  1180. with the -DDEBUG flag.
  1181.  
  1182.      The debug command lists statistics for the blocks which
  1183.  
  1184.  
  1185.  
  1186.                           09/23/93
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. 3-10                COLON MODE COMMANDS                 3-10
  1193.  
  1194.  
  1195. contain  the specified range of lines.  If the ! is present,
  1196. then the contents of those blocks is displayed, too.
  1197.  
  1198.      The  validate  command  checks  certain  variables  for
  1199. internal  consistency.   Normally it doesn't output anything
  1200. unless it detects a problem.  With the !,  though,  it  will
  1201. always produce *some* output.
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.                           09/23/93
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261. 4.  REGULAR EXPRESSIONS
  1262.  
  1263.  
  1264.      Elvis uses regular expressions for searching  and  sub-
  1265. stututions.   A regular expression is a text string in which
  1266. some characters have special meanings.  This  is  much  more
  1267. powerful than simple text matching.
  1268.  
  1269. Syntax
  1270.  
  1271.      Elvis' regexp package  treats  the  following  one-  or
  1272. two-character  strings  (called  meta-characters) in special
  1273. ways:
  1274.  
  1275. \(subexpression\)
  1276.         The \( and \) metacharacters  are  used  to  delimit
  1277.         subexpressions.  When the regular expression matches
  1278.         a particular chunk  of  text,  Elvis  will  remember
  1279.         which  portion  of that chunk matched the subexpres-
  1280.         sion.  The :s/regexp/newtext/ command makes  use  of
  1281.         this feature.
  1282.  
  1283. ^       The ^ metacharacter matches the beginning of a line.
  1284.         If,  for  example,  you  wanted to find "foo" at the
  1285.         beginning of a line, you would use a regular expres-
  1286.         sion  such  as  /^foo/.  Note that ^ is only a meta-
  1287.         character if it occurs at the beginning of a regular
  1288.         expression; anyplace else, it is treated as a normal
  1289.         character.
  1290.  
  1291. $       The $ metacharacter matches the end of a  line.   It
  1292.         is only a metacharacter when it occurs at the end of
  1293.         a regular expression; elsewhere, it is treated as  a
  1294.         normal  character.  For example, the regular expres-
  1295.         sion /$$/ will search for a dollar sign at  the  end
  1296.         of a line.
  1297.  
  1298. \<      The \< metacharacter matches a zero-length string at
  1299.         the beginning of a word.  A word is considered to be
  1300.         a string of 1 or more letters and  digits.   A  word
  1301.         can  begin  at the beginning of a line or after 1 or
  1302.         more non-alphanumeric characters.
  1303.  
  1304. \>      The \> metacharacter matches a zero-length string at
  1305.         the end of a word.  A word can end at the end of the
  1306.         line or before 1 or  more  non-alphanumeric  charac-
  1307.         ters.    For   example,  /\<end\>/  would  find  any
  1308.         instance of the word "end",  but  would  ignore  any
  1309.         instances  of  e-n-d  inside  another  word  such as
  1310.         "calendar".
  1311.  
  1312. .       The . metacharacter matches any single character.
  1313.  
  1314. [character-list]
  1315.  
  1316.  
  1317.  
  1318.                           09/23/93
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. 4-2                 REGULAR EXPRESSIONS                  4-2
  1325.  
  1326.  
  1327.         This  matches  any   single   character   from   the
  1328.         character-list.   Inside the character-list, you can
  1329.         denote a span of  characters  by  writing  only  the
  1330.         first  and  last  characters,  with a hyphen between
  1331.         them.  If the character-list  is  preceded  by  a  ^
  1332.         character,  then  the  list  is  inverted -- it will
  1333.         match character that isn't mentioned  in  the  list.
  1334.         For  example, /[a-zA-Z]/ matches any letter, and /[^
  1335.         ]/ matches anything other than a blank.
  1336.  
  1337. \{n\}   This is a closure operator, which means that it  can
  1338.         only be placed after something that matches a single
  1339.         character.  It controls the number of times that the
  1340.         single-character expression should be repeated.
  1341.  
  1342.         The \{n\} operator, in particular,  means  that  the
  1343.         preceding  expression  should  be repeated exactly n
  1344.         times.  For example, /^-\{80\}$/ matches a  line  of
  1345.         eighty  hyphens, and /\<[a-zA-Z]\{4\}\>/ matches any
  1346.         four-letter word.
  1347.  
  1348. \{n,m\} This is a closure  operator  which  means  that  the
  1349.         preceding   single-character  expression  should  be
  1350.         repeated between n and m times, inclusive.  If the m
  1351.         is  omitted  (but  the  comma  is present) then m is
  1352.         taken to be inifinity.  For example, /"[^"]\{3,5\}"/
  1353.         matches  any  pair  of  quotes which contains three,
  1354.         four, or five non-quote characters.
  1355.  
  1356. *       The * metacharacter  is  a  closure  operator  which
  1357.         means that the preceding single-character expression
  1358.         can  be  repeated  zero  or  more  times.    It   is
  1359.         equivelent  to  \{0,\}.  For example, /.*/ matches a
  1360.         whole line.
  1361.  
  1362. \+      The \+ metacharacter is  a  closure  operator  which
  1363.         means that the preceding single-character expression
  1364.         can be repeated one or more times.  It is equivelent
  1365.         to \{1,\}.  For example, /.\+/ matches a whole line,
  1366.         but only if the line contains at least  one  charac-
  1367.         ter.  It doesn't match empty lines.
  1368.  
  1369. \?      The \? metacharacter is  a  closure  operator  which
  1370.         indicates   that   the   preceding  single-character
  1371.         expression is optional -- that is, that it can occur
  1372.         0  or  1  times.   It is equivelent to \{0,1\}.  For
  1373.         example, /no[ -]\?one/ matches "no  one",  "no-one",
  1374.         or "noone".
  1375.  
  1376.      Anything else is treated as a  normal  character  which
  1377. must  exactly  match a character from the scanned text.  The
  1378. special strings may all be preceded by a backslash to  force
  1379. them to be treated normally.
  1380.  
  1381.  
  1382.  
  1383.  
  1384.                           09/23/93
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390. 4-3                 REGULAR EXPRESSIONS                  4-3
  1391.  
  1392.  
  1393. Substitutions
  1394.  
  1395.      The :s command has at least two  arguments:  a  regular
  1396. expression,  and  a  substitution  string.   The  text  that
  1397. matched the regular expression is replaced by text which  is
  1398. derived from the substitution string.
  1399.  
  1400.      Most characters in the substitution string  are  copied
  1401. into the text literally but a few have special meaning:
  1402.  
  1403.        &     Insert a copy of the original text
  1404.        ~     Insert a copy of the previous replacement text
  1405.        \1    Insert a copy of that portion of the original text which
  1406.              matched the first set of \( \) parentheses
  1407.        \2-\9 Do the same for the second (etc.) pair of \( \)
  1408.        \U    Convert all chars of any later & or \# to uppercase
  1409.        \L    Convert all chars of any later & or \# to lowercase
  1410.        \E    End the effect of \U or \L
  1411.        \u    Convert the first char of the next & or \# to uppercase
  1412.        \l    Convert the first char of the next & or \# to lowercase
  1413.  
  1414.  
  1415.      These may be preceded by a backslash to force  them  to
  1416. be treated normally.  If "nomagic" mode is in effect, then &
  1417. and ~ will be treated normally, and you must write  them  as
  1418. \& and \~ for them to have special meaning.
  1419.  
  1420. Options
  1421.  
  1422.      Elvis has two options  which  affect  the  way  regular
  1423. expressions  are used.  These options may be examined or set
  1424. via the :set command.
  1425.  
  1426.      The first option is  called  "[no]magic".   This  is  a
  1427. boolean  option, and it is "magic" (TRUE) by default.  While
  1428. in  magic  mode,  all  of  the  meta-characters  behave   as
  1429. described above.  In nomagic mode, only ^ and $ retain their
  1430. special meaning.
  1431.  
  1432.      The second option is called "[no]ignorecase".  This  is
  1433. a  boolean  option,  and  it  is  "noignorecase"  (FALSE) by
  1434. default.  While in ignorecase mode, the searching  mechanism
  1435. will  not  distinguish  between  an uppercase letter and its
  1436. lowercase form.  In noignorecase mode, uppercase and  lower-
  1437. case are treated as being different.
  1438.  
  1439.      Also, the "[no]wrapscan" option affects searches.
  1440.  
  1441. Examples
  1442.  
  1443.      This example changes every occurence  of  "utilize"  to
  1444. "use":
  1445.  
  1446.           :%s/utilize/use/g
  1447.  
  1448.  
  1449.  
  1450.                           09/23/93
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456. 4-4                 REGULAR EXPRESSIONS                  4-4
  1457.  
  1458.  
  1459.      This example deletes all whitespace that occurs at  the
  1460. end of a line anywhere in the file.  (The brackets contain a
  1461. single space and a single tab.):
  1462.  
  1463.           :%s/[   ]\+$//
  1464.  
  1465.      This example converts the current line to uppercase:
  1466.  
  1467.           :s/.*/\U&/
  1468.  
  1469.      This example underlines  each  letter  in  the  current
  1470. line,  by  changing it into an "underscore backspace letter"
  1471. sequence.  (The ^H is entered as "control-V backspace".):
  1472.  
  1473.           :s/[a-zA-Z]/_^H&/g
  1474.  
  1475.      This example locates the last  colon  in  a  line,  and
  1476. swaps  the  text  before  the  colon with the text after the
  1477. colon.  The first \( \) pair is used to  delimit  the  stuff
  1478. before  the  colon,  and  the  second pair delimit the stuff
  1479. after.  In the substitution text, \1 and  \2  are  given  in
  1480. reverse order to perform the swap:
  1481.  
  1482.           :s/\(.*\):\(.*\)/\2:\1/
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.                           09/23/93
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525. 5.  OPTIONS
  1526.  
  1527.      Options may be set or examined via  the  colon  command
  1528. "set".   The  values of options will affect the operation of
  1529. later commands.
  1530.  
  1531.      For convenience, options have both a  long  descriptive
  1532. name  and  a  short name which is easy to type.  You may use
  1533. either name interchangably.  I like the short names, myself.
  1534.  
  1535.      There are three types of options: Boolean, string,  and
  1536. numeric.   Boolean  options are made TRUE by giving the name
  1537. of the option as an argument to the "set" command; they  are
  1538. made  FALSE  by  prefixing the name with "no".  For example,
  1539. "set autoindent" makes the autoindent option TRUE, and  "set
  1540. noautoindent"  makes  it  FALSE.   Elvis also allows boolean
  1541. options to be toggled by prefixing the name with "neg".  So,
  1542. ":map  g  :set  neglist^M"  will cause the <g> key to alter-
  1543. nately toggle the "list" option on and off.  (The "neg" pre-
  1544. fix is an extension; the real vi doesn't support it.)
  1545.  
  1546.      To change the value of a string or numeric option, pass
  1547. the "set" command the name of the option, followed by an "="
  1548. sign  and  the  option's  new  value.   For  example,   "set
  1549. tabstop=8"  will  give the tabstop option a value of 8.  For
  1550. string options, you may enclose the new value in quotes.
  1551.  
  1552. NAMES              TYPE DEFAULT       MEANING
  1553. autoindent, ai     Bool noai          auto-indent during input
  1554. autoprint, ap      Bool ap            in EX, print the current line
  1555. autotab, at        Bool at            auto-indent allowed to use tabs?
  1556. autowrite, aw      Bool noaw          auto-write when switching files
  1557. beautify,  bf      Bool nobf          strip control chars from file?
  1558. charattr, ca       Bool noca          interpret \fX sequences?
  1559. cc, cc             Str  cc="cc -c"    name of the C compiler
  1560. columns, co        Num  co=80         width of the screen
  1561. digraph, dig       Bool nodig         recognize digraphs?
  1562. directory, dir     Str  dir="/usr/tmp"where tmp files are kept
  1563. edcompatible, ed   Bool noed          remember ":s//" options
  1564. equalprg, ep       Bool ep="fmt"      program to run for = operator
  1565. errorbells, eb     Bool eb            ring bell on error
  1566. exrc, exrc         Bool noexrc        read "./.exrc" file?
  1567. exrefresh, er      Bool er            write lines indiviually in EX
  1568. flash, vbell       Bool flash         use visible alternative to bell
  1569. flipcase, fc       Str  fc=""         non-ASCII chars flipped by ~
  1570. hideformat, hf     Bool hf            hide text formatter commands
  1571. ignorecase, ic     Bool noic          upper/lowercase match in search
  1572. inputmode, im      Bool noim          start vi in insert mode?
  1573. keytime, kt        Num  kt=2          timeout for mapped key entry
  1574. keywordprg, kp     Str  kp="ref"      full pathname of shift-K prog
  1575. lines, ln          Num  ln=25         number of lines on the screen
  1576. list, li           Bool noli          display lines in "list" mode
  1577. magic, ma          Bool ma            use regular expression in search
  1578. make, mk           Str  mk="make"     name of the "make" program
  1579.  
  1580.  
  1581.  
  1582.                           09/23/93
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588. 5-2                       OPTIONS                        5-2
  1589.  
  1590.  
  1591. mesg, ms           Bool ms            allow messages from other users?
  1592. modelines, ml      Bool noml          are modelines processed?
  1593. more, more         Bool more          pause between messages?
  1594. nearscroll, ns     Num  ns=15         when to scroll vs. redraw
  1595. novice, nov        Bool nonovice      set options for ease of use
  1596. number, nu         Bool nonumber      show line numbers
  1597. paragraphs, para   Str  para="PPppIPLPQP"names of "paragraph" nroff cmd
  1598. prompt, pr         Bool pr            show ':' prompt in ex mode
  1599. readonly, ro       Bool noro          prevent overwriting of orig file
  1600. remap, rem         Bool remap         allow key maps to call key maps
  1601. report, re         Num  re=5          report when 5 or more changes
  1602. ruler, ru          Bool noru          display line/column numbers
  1603. scroll, sc         Num  sc=12         scroll amount for ^U and ^D
  1604. sections, sect     Str  sect="NHSHSSSEse"names of "section" nroff cmd
  1605. shell, sh          Str  sh="/bin/sh"  full pathname of the shell
  1606. showmatch, sm      Bool nosm          show matching ()[]{}
  1607. showmode, smd      Bool nosmd         say when we're in input mode
  1608. shiftwidth, sw     Num  sw=8          shift amount for < and >
  1609. sidescroll, ss     Num  ss=8          amount of sideways scrolling
  1610. sync, sy           Bool nosy          call sync() often
  1611. tabstop, ts        Num  ts=8          width of tab characters
  1612. taglength, tl      Num  tl=0          significant chars in tag name
  1613. tags, tag          Str  tags="tags" list of tags files
  1614. tagstack, tgs      Bool tgs           enable tagstack?
  1615. term, te           Str  te="$TERM"    name of the termcap entry
  1616. terse, tr          Bool notr          give shorter error messages
  1617. timeout, to        Bool to            distinguish <esc> from <arrow>?
  1618. warn, wa           Bool wa            warn for ! if file modified
  1619. window, wi         Num  wi=24         lines to redraw after long move
  1620. wrapmargin, wm     Num  wm=0          wrap long lines in input mode
  1621. wrapscan, ws       Bool ws            at EOF, searches wrap to line 1
  1622. writeany, wr       Bool nowr          allow :w to clobber files
  1623.  
  1624.  
  1625. autoindent, ai
  1626.      During input mode, the  autoindent  option  will  cause
  1627.      each  added line to begin with the same amount of lead-
  1628.      ing whitespace as the line above it.   Without  autoin-
  1629.      dent, added lines are initially empty.
  1630.  
  1631. autoprint, ap
  1632.      This option only affects EX  mode.   If  the  autoprint
  1633.      option  on,  and  either the cursor has moved to a dif-
  1634.      ferent line or the previous command modified the  file,
  1635.      then Elvis will print the current line.
  1636.  
  1637. autotab, at
  1638.      This option affects the  behaviour  of  the  autoindent
  1639.      mode.  If autoindent is turned off, then autotab has no
  1640.      effect.
  1641.  
  1642.      When autotab is turned on, elvis will use a mixture  of
  1643.      spaces and tabs to create the proper amount of indenta-
  1644.      tion.  This is the default.
  1645.  
  1646.  
  1647.  
  1648.                           09/23/93
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654. 5-3                       OPTIONS                        5-3
  1655.  
  1656.  
  1657.      When autotab is turned off, elvis will only use  spaces
  1658.      for  auto-indent.   Elvis  will still insert a real tab
  1659.      character when you hit the <Tab> key, though; the auto-
  1660.      tab option only affects automatic indentation.
  1661.  
  1662. autowrite, aw
  1663.      When you're editing one file and decide  to  switch  to
  1664.      another  -  via  the  :tag  command,  or :next command,
  1665.      perhaps - if your current file has been modified,  then
  1666.      Elvis  will  normally print an error message and refuse
  1667.      to switch.
  1668.  
  1669.      However, if the autowrite option is on, then Elvis will
  1670.      write the modified version of the current file and suc-
  1671.      cessfully switch to the new file.
  1672.  
  1673. beautify, bf
  1674.      This option causes all control characters to be deleted
  1675.      from  the text file, at the time when you start editing
  1676.      it.  If you're already editing a file when you turn  on
  1677.      the beautify option, then that file won't be affected.
  1678.  
  1679. cc   The :cc command  runs  the  C  compiler.   This  option
  1680.      should be set to the name of your compiler.
  1681.  
  1682. charattr, ca
  1683.      Many text formatting programs allow  you  to  designate
  1684.      portions  of your text to be underlined, italicized, or
  1685.      boldface by embedding the special strings \fU, \fI, and
  1686.      \fB in your text.  The special string \fP marks the end
  1687.      of underlined or boldface text.
  1688.  
  1689.      Elvis normally treats those special strings  just  like
  1690.      any other text.
  1691.  
  1692.      However, if the charattr option is on, then Elvis  will
  1693.      interpret  those  special strings correctly, to display
  1694.      underlined or boldface text on the screen.  (This  only
  1695.      works,  of  course, if your terminal can display under-
  1696.      lined and boldface, and if the TERMCAP entry  says  how
  1697.      to do it.)
  1698.  
  1699. columns, co
  1700.      This option shows how wide your screen is.
  1701.  
  1702. digraph, dig
  1703.      This option is used to  enable/disable  recognition  of
  1704.      digraphs.   The default value is nodigraph, which means
  1705.      that digraphs will not be recognized.
  1706.  
  1707. directory, dir
  1708.      Elvis stores text  in  temporary  files.   This  option
  1709.      allows  you  to control which directory those temporary
  1710.      files will appear in.  The default is /usr/tmp.
  1711.  
  1712.  
  1713.  
  1714.                           09/23/93
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720. 5-4                       OPTIONS                        5-4
  1721.  
  1722.  
  1723.      This option can only be set  in  a  .exrc  file;  after
  1724.      that,  Elvis will have already started making temporary
  1725.      files in some other directory, so it would be too late.
  1726.  
  1727. edcompatible, ed
  1728.      This   option   affects   the    behaviour    of    the
  1729.      ":s/regexp/text/options"  command.   It is normally off
  1730.      (:se noed) which causes all of the substitution options
  1731.      to be off unless explicitly given.
  1732.  
  1733.      However, with edcompatible on (:se ed),  the  substitu-
  1734.      tion  command  remembers  which  options  you used last
  1735.      time.  Those same options  will  continue  to  be  used
  1736.      until  you change them.  In edcompatible mode, when you
  1737.      explicitly give the name of a substitution option,  you
  1738.      will toggle the state of that option.
  1739.  
  1740.      This all seems very strange to me, but its  implementa-
  1741.      tion  was  almost free when I added the ":&" command to
  1742.      repeat the previous substitution, so there it is.
  1743.  
  1744. equalprg, ep
  1745.      This holds the name & arguments of the external  filter
  1746.      program  used  the  the visual = operator.  The defualt
  1747.      value is "fmt", so the  =  operator  will  adjust  line
  1748.      breaks in text.
  1749.  
  1750. errorbells, eb
  1751.      Elvis normally rings  a  bell  when  you  do  something
  1752.      wrong.  This option lets you disable the bell.
  1753.  
  1754. exrc This option specifies  whether  a  .exrc  file  in  the
  1755.      current directory should be executed.  By default, this
  1756.      option is off (":set noexrc") which prevents elvis from
  1757.      executing .exrc in the current directory.  If the .exrc
  1758.      file in your home directory turns this option on (":set
  1759.      exrc") then the Elvis will attempt to execute the .exrc
  1760.      file in the current directory.
  1761.  
  1762.      This option  exist  mainly  for  security  reasons.   A
  1763.      mean-spirited person could do something like
  1764.           echo >/tmp/.exrc '!rm -rf $HOME'
  1765.      and then anybody who attempted to edit or view  a  file
  1766.      in  the  /tmp directory would lose most of their files.
  1767.      With the exrc option turned off, this  couldn't  happen
  1768.      to you.
  1769.  
  1770. exrefresh, er
  1771.      The EX mode of Elvis writes many lines to  the  screen.
  1772.      You can make Elvis either write each line to the screen
  1773.      separately, or save up many lines and write them all at
  1774.      once.
  1775.  
  1776.      The exrefresh option is normally on, so  each  line  is
  1777.  
  1778.  
  1779.  
  1780.                           09/23/93
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786. 5-5                       OPTIONS                        5-5
  1787.  
  1788.  
  1789.      written to the screen separately.
  1790.  
  1791.      You may wish to turn  the  exrefresh  option  off  (:se
  1792.      noer)  if  the  "write"  system  call is costly on your
  1793.      machine, or if you're using  a  windowing  environment.
  1794.      (Windowing  environments  scroll text a lot faster when
  1795.      you write many lines at once.)
  1796.  
  1797.      This option has no effect in  visual  command  mode  or
  1798.      input mode.
  1799.  
  1800. flash, vbell
  1801.      If your termcap entry describes a  visible  alternative
  1802.      to  ringing your terminal's bell, then this option will
  1803.      say whether the visible version gets used or not.  Nor-
  1804.      mally it will be.
  1805.  
  1806.      If your termcap does NOT include a visible  bell  capa-
  1807.      bility,  then  the  flash  option  will be off, and you
  1808.      can't turn it on.
  1809.  
  1810. flipcase, fc
  1811.      The flipcase option allows you to control how the  non-
  1812.      ASCII characters are altered by the "~" command.
  1813.  
  1814.      The string is divided into pairs of  characters.   When
  1815.      "~" is applied to a non-ASCII character, Elvis looks up
  1816.      the character in the flipcase string to see which  pair
  1817.      it's  in, and replaces it by the other character of the
  1818.      pair.
  1819.  
  1820. hideformat, hf
  1821.      Many text formatters require you to embed  format  com-
  1822.      mands  in  your  text,  on  lines that start with a "."
  1823.      character.  Elvis normally displays  these  lines  like
  1824.      any  other  text,  but  if the hideformat option is on,
  1825.      then format lines are displayed as blank lines.
  1826.  
  1827. ignorecase, ic
  1828.      Normally, when  Elvis  searches  for  text,  it  treats
  1829.      uppercase  letters  as  being  different  for lowercase
  1830.      letters.
  1831.  
  1832.      When the ignorecase option is on, uppercase and  lower-
  1833.      case are treated as equal.
  1834.  
  1835. inputmode, im
  1836.      This option allows you to have Elvis start up in insert
  1837.      mode.   You  can  still exit insert mode at any time by
  1838.      hitting the ESC key, as usual.   Usually,  this  option
  1839.      would be set in your ".exrc" file.
  1840.  
  1841. keytime, kt
  1842.      The arrow keys of most terminals send a multi-character
  1843.  
  1844.  
  1845.  
  1846.                           09/23/93
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852. 5-6                       OPTIONS                        5-6
  1853.  
  1854.  
  1855.      sequence.   It  takes  a  measurable amount of time for
  1856.      these sequences to be transmitted.  The keytime  option
  1857.      allows  you  to  control  the maximum amount of time to
  1858.      allow for an arrow key (or  other  mapped  key)  to  be
  1859.      received in full.
  1860.  
  1861.      On most systems, the setting is the number of tenths of
  1862.      a  second  to  allow between characters.  On some other
  1863.      systems, the setting is in whole seconds.
  1864.  
  1865.      Try to avoid  setting  keytime=1.   Most  systems  just
  1866.      count  clock beats, so if you tried to read a character
  1867.      shortly before a clock beat, you could allow almost  no
  1868.      time  at  all  for  reading the characters.  For higher
  1869.      keytime settings, the difference is less critical.
  1870.  
  1871.      If your system's response time is poor, you might  want
  1872.      to  increase  the  keytime.   In particular, I've found
  1873.      that when keystrokes must be  sent  through  a  network
  1874.      (via  X  windows,  rlogin,  or telnet, for example) the
  1875.      keytime should be set to at least 1 second.
  1876.  
  1877.      As a special case, you can set keytime to 0 to  disable
  1878.      this time limit stuff altogether.  The big problem here
  1879.      is:  If your arrow keys' sequences start with  an  ESC,
  1880.      then every time you hit your ESC key Elvis will wait...
  1881.      and wait...  to see if maybe that ESC was  part  of  an
  1882.      arrow key's sequence.
  1883.  
  1884.      NOTE: this option is a generalization  of  the  timeout
  1885.      option of the real vi.
  1886.  
  1887. keywordprg, kp
  1888.      Elvis has a special keyword lookup feature.   You  move
  1889.      the cursor onto a word, and hit shift-K, and Elvis uses
  1890.      another program to look up the word and display  infor-
  1891.      mation about it.
  1892.  
  1893.      This option says which program gets run.
  1894.  
  1895.      The default value of this option is "ref", which  is  a
  1896.      program  that  looks up the definition of a function in
  1897.      C.  It looks up the function  name  in  a  file  called
  1898.      "refs" which is created by ctags.
  1899.  
  1900.      You can subtitute other programs, such  as  an  English
  1901.      dictionary  program  or  the online manual.  Elvis runs
  1902.      the program, using the keyword as  its  only  argument.
  1903.      The  program  should  write information to stdout.  The
  1904.      program's exit status should  be  0,  unless  you  want
  1905.      Elvis to print "<<< failed >>>".
  1906.  
  1907. lines, ln
  1908.      This option says how many lines you screen has.
  1909.  
  1910.  
  1911.  
  1912.                           09/23/93
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918. 5-7                       OPTIONS                        5-7
  1919.  
  1920.  
  1921. list, li
  1922.      In nolist mode (the default), Elvis displays text in  a
  1923.      "normal" manner -- with tabs expanded to an appropriate
  1924.      number of spaces, etc.
  1925.  
  1926.      However, sometimes it is useful to have tab  characters
  1927.      displayed   differently.    In   list  mode,  tabs  are
  1928.      displayed as "^I", and a "$" is displayed at the end of
  1929.      each line.
  1930.  
  1931. magic, ma
  1932.      The search  mechanism  in  Elvis  can  accept  "regular
  1933.      expressions"  --  strings  in  which certain characters
  1934.      have special meaning.
  1935.  
  1936.      The magic option is normally  on,  which  causes  these
  1937.      characters to be treated specially.
  1938.  
  1939.      If you turn the magic option off (:se noma),  then  all
  1940.      characters except ^ and $ are treated literally.  ^ and
  1941.      $ retain their special meanings regardless of the  set-
  1942.      ting of magic.
  1943.  
  1944. make, mk
  1945.      The :make  command  runs  your  "make"  program.   This
  1946.      option defines the name of your "make" program.
  1947.  
  1948. mesg With the  real  vi,  running  under  real  UNIX,  ":set
  1949.      nomesg" would prevent other users from sending you mes-
  1950.      sages.  Elvis ignores it, though.
  1951.  
  1952. modelines, ml
  1953.      Elvis supports modelines.  Modelines are lines near the
  1954.      beginning  or  end  of  your  text  file  which contain
  1955.      "ex:yowza:", where "yowza" is any EX command.  A  typi-
  1956.      cal  "yowza"  would  be  something  like  "set  ts=5 ca
  1957.      kp=spell wm=15".  Other text may also appear on a mode-
  1958.      line, so you can place the "ex:yowza:" in a comment:
  1959.  
  1960.              /* ex:set sw=4 ai: */
  1961.  
  1962.  
  1963.      Normally these lines are ignored, for security reasons,
  1964.      but if you have "set modelines" in your .exrc file then
  1965.      "yowza" is executed.
  1966.  
  1967. nearscroll, ns
  1968.      The line that contains the cursor will always be on the
  1969.      screen.  If you move the cursor to a line that isn't on
  1970.      the screen, then  elvis  will  either  scroll  (if  the
  1971.      cursor's  line  is  nearly  on  the  screen already) or
  1972.      redraw the screen completely  with  the  cursor's  line
  1973.      centered  (if  the  cursor  line is not near the screen
  1974.      already).
  1975.  
  1976.  
  1977.  
  1978.                           09/23/93
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984. 5-8                       OPTIONS                        5-8
  1985.  
  1986.  
  1987.      This option  allows  you  to  control  elvis'  idea  of
  1988.      "near".   A value of 15 is typical.  A value of 1 would
  1989.      cause elvis to scroll no more that one line.   A  value
  1990.      of 0 disables scrolling.
  1991.  
  1992. novice, nov
  1993.      The  command  ":set  novice"  is  equivelent  to  ":set
  1994.      nomagic report=1 showmode".
  1995.  
  1996. number, nu
  1997.      The  "number"  option  causes  Elvis  to  display  line
  1998.      numbers at the start of each line.  The numbers are not
  1999.      actually part of the text; when  the  file  is  written
  2000.      out, it will be written without line numbers.
  2001.  
  2002. paragraphs, pa
  2003.      The { and } commands move the cursor forward  or  back-
  2004.      ward in increments of one paragraph.  Paragraphs may be
  2005.      separated by blank lines, or by a "dot"  command  of  a
  2006.      text  formatter.   Different  text  formatters use dif-
  2007.      ferent "dot" commands.  This option allows you to  con-
  2008.      figure Elvis to work with your text formatter.
  2009.  
  2010.      It is assumed that your formatter  uses  commands  that
  2011.      start  with a "." character at the front of a line, and
  2012.      then have a one- or two-character command name.
  2013.  
  2014.      The value of the paragraphs option is a string in which
  2015.      each  pair  of  characters is one possible form of your
  2016.      text formatter's paragraph command.
  2017.  
  2018. more When Elvis must display a sequence of messages  at  the
  2019.      bottom  line  of the screen in visual mode, it normally
  2020.      pauses after all but the last one, so you have time  to
  2021.      read them all.
  2022.  
  2023.      If you turn off the "more" option, then Elvis will  not
  2024.      pause.   This means you can only read the last message,
  2025.      but it is usually the most important one anyway.
  2026.  
  2027. prompt, pr
  2028.      If you ":set noprompt", then Elvis will no longer  emit
  2029.      a  ':'  when  it  expects you to type in an ex command.
  2030.      This is slightly useful if you're  using  an  astonish-
  2031.      ingly  slow  UNIX  machine, but the rest of us can just
  2032.      ignore this one.
  2033.  
  2034. readonly, ro
  2035.      Normally, Elvis will let you write  back  any  file  to
  2036.      which  you  have  write  permission.  If you don't have
  2037.      write permission, then you can only write  the  changed
  2038.      version of the file to a different file.
  2039.  
  2040.      If you set the readonly option, then Elvis will pretend
  2041.  
  2042.  
  2043.  
  2044.                           09/23/93
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050. 5-9                       OPTIONS                        5-9
  2051.  
  2052.  
  2053.      you  don't  have write permission to any file you edit.
  2054.      It is useful when you really only mean to use Elvis  to
  2055.      look  at  a file, not to change it.  This way you can't
  2056.      change it accidentally.
  2057.  
  2058.      This option is normally off, unless you use the  "view"
  2059.      alias  of  Elvis.   "View" is like "vi" except that the
  2060.      readonly option is on.
  2061.  
  2062. remapThe ":map"  command  allows  you  to  convert  one  key
  2063.      sequence  into another.  The remap option allows you to
  2064.      specify what should happen if portions  of  that  other
  2065.      sequence  are  also  in the map table.  If remap is on,
  2066.      then those portions will also be  mapped,  just  as  if
  2067.      they  had been typed on the keyboard.  If remap is off,
  2068.      then the matching portions will not be mapped.
  2069.  
  2070.      For example, if you enter the commands ":map A  B"  and
  2071.      ":map  B C", then when remap is on, A will be converted
  2072.      to C.  But when remap is off, A will be converted  only
  2073.      to B.
  2074.  
  2075. report, re
  2076.      Commands in Elvis may affect many lines.  For  commands
  2077.      that affect a lot of lines, Elvis will output a message
  2078.      saying what was done and how many lines were  affected.
  2079.      This  option allows you to define what "a lot of lines"
  2080.      means.  The default is 5, so any command which  affects
  2081.      5 or more lines will cause a message to be shown.
  2082.  
  2083. ruler, ru
  2084.      This option is normally off.  If you turn it  on,  then
  2085.      Elvis  will  constantly display the line/column numbers
  2086.      of the cursor, at the bottom of the screen.
  2087.  
  2088. scroll, sc
  2089.      The ^U and ^D keys normally scroll backward or  forward
  2090.      by half a screenful, but this is adjustable.  The value
  2091.      of this option says how many lines  those  keys  should
  2092.      scroll  by.   If you invoke ^U or ^D with a count argu-
  2093.      ment (for example, "33^D") then this option's value  is
  2094.      set to the count.
  2095.  
  2096. sections, se
  2097.      The [[ and ]] commands move the cursor backward or for-
  2098.      ward  in increments of 1 section.  Sections may be del-
  2099.      imited by a { character in column 1  (which  is  useful
  2100.      for  C  source  code) or by means of a text formatter's
  2101.      "dot" commands.
  2102.  
  2103.      This option allows you to configure Elvis to work  with
  2104.      your text formatter's "section" command, in exectly the
  2105.      same way that the paragraphs option makes it work  with
  2106.      the formatter's "paragraphs" command.
  2107.  
  2108.  
  2109.  
  2110.                           09/23/93
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116. 5-10                      OPTIONS                       5-10
  2117.  
  2118.  
  2119. shell, sh
  2120.      When Elvis forks a shell (perhaps for the :! or  :shell
  2121.      commands)  this is the program that is uses as a shell.
  2122.      This is "/bin/sh" by default, unless you have  set  the
  2123.      SHELL (or COMSPEC, for MS-DOS) environment variable, it
  2124.      which  case  the  default  value  is  copied  from  the
  2125.      environment.
  2126.  
  2127. shiftwidth, sw
  2128.      The < and > commands shift text left or right  by  some
  2129.      uniform  number  of  columns.   The  shiftwidth  option
  2130.      defines that "uniform number".  The default is 8.
  2131.  
  2132. showmatch, sm
  2133.      With showmatch set, in input mode every  time  you  hit
  2134.      one  of  )}], Elvis will momentarily move the cursor to
  2135.      the matching ({[.
  2136.  
  2137. showmode, smd
  2138.      In visual mode, it is easy to forget whether you're  in
  2139.      the  visual  command  mode or input/replace mode.  Nor-
  2140.      mally, the showmode option is off, and  you  haven't  a
  2141.      clue  as  to  which  mode  you're  in.  If you turn the
  2142.      showmode option  on,  though,  a  little  message  will
  2143.      appear  in  the lower right-hand corner of your screen,
  2144.      telling you which mode you're in.
  2145.  
  2146. sidescroll, ss
  2147.      For long lines, Elvis scrolls sideways.  (This is  dif-
  2148.      ferent from the real vi, which wraps a single long line
  2149.      onto several rows of the screen.)
  2150.  
  2151.      To minimize the number of scrolls needed,  Elvis  moves
  2152.      the  screen  sideways  by several characters at a time.
  2153.      The value of this  option  says  how  many  characters'
  2154.      widths to scroll at a time.
  2155.  
  2156.      Generally, the faster your screen can be  redrawn,  the
  2157.      lower the value you will want in this option.
  2158.  
  2159. sync, sy
  2160.      If the system crashes during an edit session, then most
  2161.      of  your  work can be recovered from the temporary file
  2162.      that Elvis uses to store changes.   However,  sometimes
  2163.      the  OS  will not copy changes to the hard disk immedi-
  2164.      ately, so recovery might not be possible.  The [no]sync
  2165.      option lets you control this.
  2166.  
  2167.      In nosync mode (which is the default, for UNIX),  Elvis
  2168.      lets  the operating system control when data is written
  2169.      to the disk.  This is generally faster.
  2170.  
  2171.      In sync mode (which is the default for  MS-DOS,  Amiga-
  2172.      Dos,  and  Atari  TOS), Elvis forces all changes out to
  2173.  
  2174.  
  2175.  
  2176.                           09/23/93
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182. 5-11                      OPTIONS                       5-11
  2183.  
  2184.  
  2185.      disk every time you make a change.  This  is  generally
  2186.      safer,  but slower.  It can also be a rather rude thing
  2187.      to do on a multi-user system.
  2188.  
  2189. tabstop, ts
  2190.      Tab characters are normally 8 characters wide, but  you
  2191.      can change their widths by means of this option.
  2192.  
  2193. taglength, tl
  2194.      This option allows you to specify how  many  characters
  2195.      of  a tag's name must match when performing tag lookup.
  2196.      As a special case, ":set taglength=0"  means  that  all
  2197.      characters of a tag's name must match.
  2198.  
  2199.      Note: some configurations of Elvis don't  support  this
  2200.      option.
  2201.  
  2202. tags, tag
  2203.      If   your   version   of   elvis   is   compiled   with
  2204.      -DINTERNAL_TAGS, then this is a space-delimited list of
  2205.      tags files.  When you tell elvis to look up a  tag,  it
  2206.      searches  though  each  file in turn until it finds the
  2207.      tag.
  2208.  
  2209.      If  your  version  of   elvis   is   compiled   without
  2210.      -DINTERNAL_TAGS,  then  you can achieve the same effect
  2211.      via an environment variable called TAGPATH.   TAGPATH's
  2212.      value  is  a  colon-delimited list of file or directory
  2213.      names.  (For some operating systems, including  MS-DOS,
  2214.      the list is delimited by semicolons instead of colons.)
  2215.  
  2216. tagstack
  2217.      This option allows you  to  disable  the  tagstack.   I
  2218.      can't  think  of  any  reason  why you would want to do
  2219.      that.
  2220.  
  2221. term, te
  2222.      This read-only option shows the  name  of  the  termcap
  2223.      entry that Elvis is using for your terminal.
  2224.  
  2225. terse, tr
  2226.      The real vi uses  this  option  to  select  longer  vs.
  2227.      shorter  error  messages.   Elvis  has  only one set of
  2228.      error messages, though, so this option has no effect.
  2229.  
  2230. timeout, to
  2231.      The command ":set notimeout"  is  equivelent  to  ":set
  2232.      keytime=0",  and  ":set timeout" is equivelent to ":set
  2233.      keytime=1".  This affects the behaviour  of  the  <Esc>
  2234.      key.   See  the  discussion of the "keytime" option for
  2235.      more information.
  2236.  
  2237. warn, wa
  2238.      If you have modified a file but not yet written it back
  2239.  
  2240.  
  2241.  
  2242.                           09/23/93
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248. 5-12                      OPTIONS                       5-12
  2249.  
  2250.  
  2251.      to  disk,  then  Elvis  will  normally  print a warning
  2252.      before executing a ":!cmd" command.  However, in nowarn
  2253.      mode, this warning is not given.
  2254.  
  2255.      Elvis also normally prints a message after a successful
  2256.      search  that  wrapped  at EOF.  The [no]warn option can
  2257.      also disable this warning.
  2258.  
  2259. window, wi
  2260.      This option controls how many lines are redrawn after a
  2261.      long move.
  2262.  
  2263.      On fast terminals, this is usually set to the number of
  2264.      rows  that  the  terminal can display, minus one.  This
  2265.      causes the entire screen to be filled with text  around
  2266.      the cursor.
  2267.  
  2268.      On slow terminals, you may wish to reduce this value to
  2269.      about  7  or  so.   That way, if you're doing something
  2270.      like  repeatedly  hitting  'n'  to  search   for   each
  2271.      occurrence of some string and trying to find a particu-
  2272.      lar occurrence, then you don't need to wait as long for
  2273.      Elvis to redraw the screen after each search.
  2274.  
  2275. wrapmargin, wm
  2276.      Normally (with wrapmargin=0) Elvis will let you type in
  2277.      extremely long lines, if you wish.
  2278.  
  2279.      However, with warpmargin set to something other that  0
  2280.      (wrapmargin=10 is nice), Elvis will automatically cause
  2281.      long lines to be "wrapped" on a word  break  for  lines
  2282.      come  too close to the right-hand margin.  For example:
  2283.      On an 80-column screen, ":set wm=10" will  cause  lines
  2284.      to wrap when their length exceeds 70 columns.
  2285.  
  2286. wrapscan, ws
  2287.      Normally, when you search  for  something,  Elvis  will
  2288.      find  it  no  matter  where  it  is in the file.  Elvis
  2289.      starts at the cursor position,  and  searches  forward.
  2290.      If  Elvis  hits EOF without finding what you're looking
  2291.      for, then it wraps around to  continue  searching  from
  2292.      line  1.   If  you  turn  off  the wrapscan option (:se
  2293.      nows), then when Elvis hits EOF  during  a  search,  it
  2294.      will stop and say so.
  2295.  
  2296. writeany, wr
  2297.      With "writeany" turned off, elvis will prevent you from
  2298.      accidentally overwriting a file.  For example, if "foo"
  2299.      exists then ":w foo" will fail.  If  you  turn  on  the
  2300.      "writeany" option, then ":w foo" will work.
  2301.  
  2302.      Regardless of the setting of "writeany",  though,  ":w!
  2303.      foo"  will  work.   The  '!' forces the ":w" command to
  2304.      write the file unless the operating system won't  allow
  2305.  
  2306.  
  2307.  
  2308.                           09/23/93
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314. 5-13                      OPTIONS                       5-13
  2315.  
  2316.  
  2317.      it.
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.                           09/23/93
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383. 6.  CUT BUFFERS
  2384.  
  2385.      When Elvis deletes text, it stores that text in  a  cut
  2386. buffer.   This  happens  in  both  visual  mode and EX mode.
  2387. There is no practical limit to how much text  a  cut  buffer
  2388. can hold.
  2389.  
  2390.      There are 36 cut buffers:  26 named buffers ("a through
  2391. "z),  9  anonymous  buffers ("1 through "9), and 1 extra cut
  2392. buffer (".).
  2393.  
  2394.      In EX mode, the :move and  :copy  commands  use  a  cut
  2395. buffer to temporarily hold the text to be moved/copied.
  2396.  
  2397. 6.1.  Putting text into a Cut Buffer
  2398.  
  2399.      In visual mode, text is copied into a cut  buffer  when
  2400. you  use the d, y, c, C, s, or x commands.  There are also a
  2401. few others.
  2402.  
  2403.      By default, the text goes into the "1 buffer.  The text
  2404. that  used to be in "1 gets shifted into "2, "2 gets shifted
  2405. into "3, and so on.  The text that used to be in "9 is lost.
  2406. This  way,  the last 9 things you deleted are still accessi-
  2407. ble.
  2408.  
  2409.      You can also put the text into a  named  buffer  --  "a
  2410. through  "z.   To do this, you should type the buffer's name
  2411. (two keystrokes: a  double-quote  and  a  lowercase  letter)
  2412. before  the  command  that  will  cut the text.  When you do
  2413. this, "1 through "9 are not affected by the cut.
  2414.  
  2415.      You can append text to one of the named buffers.  To do
  2416. this,  type  the  buffer's name in uppercase (a double-quote
  2417. and an uppercase letter) before the d/y/c/C/s/x command.
  2418.  
  2419.      The ". buffer is special.  It  isn't  affected  by  the
  2420. d/y/c/C/s/x  command.   Instead, it stores the text that you
  2421. typed in the last time you were in input mode.  It  is  used
  2422. to implement the . visual command, and ^A in input mode.
  2423.  
  2424.      In EX mode (also known as  colon  mode),  the  :delete,
  2425. :change, and :yank commands all copy text into a cut buffer.
  2426. Like the visual commands, these EX commands normally use the
  2427. "1  buffer, but you can use one of the named buffers by giv-
  2428. ing its name after the command.  For example,
  2429.  
  2430.      :20,30y a
  2431.  
  2432.  
  2433. will copy lines 20 through 30 into cut buffer "a.
  2434.  
  2435.      You can't directly put text into the ". buffer, or  the
  2436. "2 through "9 buffers.
  2437.  
  2438.  
  2439.  
  2440.                           09/23/93
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446. 6-2                     CUT BUFFERS                      6-2
  2447.  
  2448.  
  2449. 6.2.  Pasting from a Cut Buffer
  2450.  
  2451.      There  are  two  styles  of  pasting:   line-mode   and
  2452. character-mode.   If a cut buffer contains whole lines (from
  2453. a command like "dd") then line-mode pasting is used;  if  it
  2454. contains  partial  lines  (from  a  command  like "dw") then
  2455. character-mode pasting is used.  The EX commands always  cut
  2456. whole lines.
  2457.  
  2458.      Character-mode pasting causes the text to  be  inserted
  2459. into the line that the cursor is on.
  2460.  
  2461.      Line-mode pasting inserts the text on a new line  above
  2462. or  below the line that the cursor is on.  It doesn't affect
  2463. the cursor's line at all.
  2464.  
  2465.      In visual mode, the p and P commands insert text from a
  2466. cut  buffer.   Uppercase P will insert it before the cursor,
  2467. and lowercase p will insert it after the cursor.   Normally,
  2468. these  commands  will  paste from the "1 buffer, but you can
  2469. specify any other buffer to paste from.  Just type its  name
  2470. (a double-quote and another character) before you type the P
  2471. or p.
  2472.  
  2473.      In EX mode, the (pu)t command pastes text after a given
  2474. line.   To paste from a buffer other that "1, enter its name
  2475. after the command.
  2476.  
  2477. 6.3.  Macros
  2478.  
  2479.      The contents of a named cut buffer can be executed as a
  2480. series of ex/vi commands.
  2481.  
  2482.      To put the instructions into the cut buffer,  you  must
  2483. first insert them into the file, and then delete them into a
  2484. named cut buffer.
  2485.  
  2486.      To execute a cut buffer's contents as EX commands,  you
  2487. should  give  the EX command "@" and the name of the buffer.
  2488. For example, :@z will execute "z as a series of EX commands.
  2489.  
  2490.      To execute a cut buffer's contents as visual  commands,
  2491. you should give the visual command "@" and the letter of the
  2492. buffer's name.  The visual "@" command is different from the
  2493. EX  "@"  command.   They interpret the cut buffer's contents
  2494. differently.
  2495.  
  2496.      The visual @ command can be rather finicky.  Each char-
  2497. acter  in the buffer is interpretted as a keystroke.  If you
  2498. load the instructions into the cut buffer via  a  "zdd  com-
  2499. mand, then the newline character at the end of the line will
  2500. be executed just like any other  character,  so  the  cursor
  2501. would be moved down 1 line.  If you don't want the cursor to
  2502. move down 1 line at the end of each  @z  command,  then  you
  2503.  
  2504.  
  2505.  
  2506.                           09/23/93
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512. 6-3                     CUT BUFFERS                      6-3
  2513.  
  2514.  
  2515. should load the cut buffer by saying 0"zD instead.
  2516.  
  2517.      Although cut buffers can hold any amount of text, Elvis
  2518. can  only  execute small buffers.  The size limit is roughly
  2519. 1000 characters, for either EX macros or VI  macros.   If  a
  2520. buffer  is  too  large  to  execute,  an  error  message  is
  2521. displayed.
  2522.  
  2523.      You can't nest :@ commands.  You can't run :@  commands
  2524. from  your  .exrc  file,  or  any other :source file either.
  2525. Similarly, you can't run a :source command from within an  @
  2526. command.   Hopefully, these restrictions will be lifted in a
  2527. later version.
  2528.  
  2529. 6.4.  The Effect of Switching Files
  2530.  
  2531.      When Elvis first starts up, all cut buffers are  empty.
  2532. When  you  switch to a different file (via the :n or :e com-
  2533. mands perhaps) the  9  anonymous  cut  buffers  are  emptied
  2534. again,  but  the  other  27  buffers ("a through "z, and ".)
  2535. retain their text.
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.                           09/23/93
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581. 7.  DIFFERENCES BETWEEN Elvis & BSD VI/EX
  2582.  
  2583.      Elvis is not  100%  compatible  with  the  real  vi/ex.
  2584. Elvis  has  many small extensions, some omissions, and a few
  2585. features which  are  implemented  in  a  slightly  different
  2586. manner.
  2587.  
  2588. 7.1.  Extensions
  2589.  
  2590. Save Configuration
  2591.           The :mkexrc command saves the current :set,  :map,
  2592.           :ab,  :color,  and  :digraph configurations in the
  2593.           ".exrc" file in your current directory.
  2594.  
  2595. Previous File
  2596.           The :N or :prev command  moves  backwards  through
  2597.           the args list.
  2598.  
  2599. Center Current Row
  2600.           In visual command mode, the (lowercase) "zz"  com-
  2601.           mand  will  center the current line on the screen,
  2602.           like "z=".
  2603.  
  2604. Changing Repeat Count
  2605.           The default count value for . is the same  as  the
  2606.           previous command which . is meant to repeat.  How-
  2607.           ever, you can supply a new count if you wish.  For
  2608.           example, after "3dw", "." will delete 3 words, but
  2609.           "5." will delete 5 words.
  2610.  
  2611. Previous Text
  2612.           The text which was most recently input (via a "cw"
  2613.           command,  or  something similar) is saved in a cut
  2614.           buffer called ". (which is a pretty hard  name  to
  2615.           write in an English sentence).
  2616.  
  2617. Keyword Lookup
  2618.           In visual command mode, you can  move  the  cursor
  2619.           onto  a word and press shift-K to have Elvis run a
  2620.           reference program to look that word up.  This com-
  2621.           mand  alone  is worth the price of admission!  See
  2622.           the ctags and ref programs.
  2623.  
  2624. Increment/Decrement
  2625.           In visual command mode, you can  move  the  cursor
  2626.           onto  a  number and then hit ## or #+ to increment
  2627.           that number by 1.  To increment  it  by  a  larger
  2628.           amount, type in the increment value before hitting
  2629.           the initial #.  The number can also be decremented
  2630.           or set by hitting #- or #=, respectively.
  2631.  
  2632. Input ModeYou can backspace past the beginning of the line.
  2633.  
  2634.           The arrow keys work in input mode.
  2635.  
  2636.  
  2637.  
  2638.                           09/23/93
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644. 7-2        DIFFERENCES BETWEEN Elvis & BSD VI/EX         7-2
  2645.  
  2646.  
  2647.           If you type control-A,  then  the  text  that  you
  2648.           input  last  time is inserted.  You will remain in
  2649.           input mode, so you can backspace over part of  it,
  2650.           or  add  more  to  it.   (This  is  sort  of  like
  2651.           control-@ on the real vi,  except  that  control-A
  2652.           really works.)
  2653.  
  2654.           Control-P will insert  the  contents  of  the  cut
  2655.           buffer.
  2656.  
  2657.           Real vi can only remember up to 128 characters  of
  2658.           input, but Elvis can remember any amount.
  2659.  
  2660.           The ^T and ^D keys can adjust the indent of a line
  2661.           no  matter  where the cursor happens to be in that
  2662.           line.
  2663.  
  2664.           You can save your file  and  exit  Elvis  directly
  2665.           from input mode by hitting control-Z twice.
  2666.  
  2667.           Elvis supports digraphs as a  way  to  enter  non-
  2668.           ASCII characters.
  2669.  
  2670. Start in Input Mode
  2671.           If you ":set inputmode" in your .exrc  file,  then
  2672.           Elvis  will  start  up  in  input  mode instead of
  2673.           visual command mode.
  2674.  
  2675. Visible Fonts
  2676.           With   ":set   charattr",   Elvis   can    display
  2677.           "backslash-f"  style  character  attributes on the
  2678.           screen as you edit.  The following  example  shows
  2679.           the recognized atributes:
  2680.  
  2681.                normal      \fBboldface\fR      \fIitalics\fR
  2682.           \fUunderlined\fR normal
  2683.  
  2684.           NOTE:  you  must   compile   Elvis   without   the
  2685.           -DNO_CHARATTR flag for this to work.
  2686.  
  2687. File Syncing
  2688.           After a crash, you can usually recover the altered
  2689.           form  of  the  file  from  the temporary file that
  2690.           Elvis uses -- unless the temporary file  was  cor-
  2691.           rupted.
  2692.  
  2693.           UNIX systems  use  a  delayed-write  cache,  which
  2694.           means  that  when Elvis tries to write to the tem-
  2695.           porary file, the information might still be in RAM
  2696.           instead  of  on the disk.  A power failure at that
  2697.           time would cause  the  in-RAM  information  to  be
  2698.           lost.   UNIX's  sync()  call  will  force all such
  2699.           information to disk.
  2700.  
  2701.  
  2702.  
  2703.  
  2704.                           09/23/93
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710. 7-3        DIFFERENCES BETWEEN Elvis & BSD VI/EX         7-3
  2711.  
  2712.  
  2713.           MS-DOS and Atari TOS don't write a  file's  length
  2714.           to  disk until that file is closed.  Consequently,
  2715.           the temporary file would appear to be 0 bytes long
  2716.           if  power  failed  when we were editing.  To avoid
  2717.           this problem, a sync() function has  been  written
  2718.           which  will  close  the  temporary  file  and then
  2719.           immediately reopen it.
  2720.  
  2721. Cursor Shape
  2722.           Elvis changes the shape of the cursor to  indicate
  2723.           which  mode  you're in, if your terminal's termcap
  2724.           entry includes the necessary capabilities.
  2725.  
  2726. Hide nroff Lines
  2727.           The ":set hideformat" option  hides  nroff  format
  2728.           control  lines.  (They are displayed on the screen
  2729.           as blank lines.)
  2730.  
  2731. Compiler Interface
  2732.           Elvis is clever enough to parse the error messages
  2733.           emitted  by  many compilers.  To use this feature,
  2734.           you should collect your compiler's error  messages
  2735.           into a file called "errlist"; Elvis will read this
  2736.           file, determine which source file caused the error
  2737.           messages, start editing that file, move the cursor
  2738.           to the line where  the  error  was  detected,  and
  2739.           display  the  error  message  on  the status line.
  2740.           Nifty!
  2741.  
  2742. Visible Text Selection
  2743.           In visual command mode, 'v' starts visibly select-
  2744.           ing  characters  and  'V' starts visibly selecting
  2745.           whole lines.  The character or line where the cur-
  2746.           sor  is located becomes one endpoint of the selec-
  2747.           tion.  You can then use the standard cursor  move-
  2748.           ment commands to move the cursor to the other end-
  2749.           point, and then press one of the operator commands
  2750.           (c/d/y/</>/!/=/\).  The operator will then immedi-
  2751.           ately be applied to the selected text.
  2752.  
  2753. Pop-up Menu Operator
  2754.           The '\' key is a new operator, similar  in  opera-
  2755.           tion to the c/d/y/</>/! operators.  It conjures up
  2756.           a menu, from which you can select any of the other
  2757.           operators plus a few other common commands.
  2758.  
  2759. Preset Filter Operator
  2760.           The '=' key is another new operator.  It is  simi-
  2761.           lar  to  the  '!'  operator, except that while '!'
  2762.           asks you to type in a filter  command  each  time,
  2763.           '='  assumes  it  should  always  run  the command
  2764.           stored in the equalprg option.
  2765.  
  2766. Move to a Given Percentage
  2767.  
  2768.  
  2769.  
  2770.                           09/23/93
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776. 7-4        DIFFERENCES BETWEEN Elvis & BSD VI/EX         7-4
  2777.  
  2778.  
  2779.           The '%' movement key can now  accept  an  optional
  2780.           count.   Without  a count, the '%' key still moves
  2781.           to a matching  parenthesis  like  it  always  did.
  2782.           With  a count somewhere between 1 and 100, though,
  2783.           it moves the cursor to approximately a given  per-
  2784.           centage of the way through the file.  For example,
  2785.           typing "50%" will move the cursor to the middle of
  2786.           the file.
  2787.  
  2788. Regular Expressions
  2789.           In regular expressions, several new forms of  clo-
  2790.           sure  operators  are supported:  \{n}, \{n,m}, \+,
  2791.           and \?.
  2792.  
  2793. 7.2.  Omissions
  2794.  
  2795.      The replace mode is a hack.  It doesn't save  the  text
  2796. that it overwrites.
  2797.  
  2798.      Long lines are displayed differently -- where the  real
  2799. vi  would  wrap a long line onto several rows of the screen,
  2800. Elvis simply displays part of the line, and  allows  you  to
  2801. scroll the screen sideways to see the rest of it.
  2802.  
  2803.      The ":preserve" and ":recover"  commands  are  missing.
  2804. So  is  the  -r  flag.   I've never had a good reason to use
  2805. ":preserve", and  since  ":recover"  is  used  so  rarely  I
  2806. decided  to  implement it as a separate program.  There's no
  2807. need to load the recovery code into memory  every  time  you
  2808. edit a file, I figured.
  2809.  
  2810.      LISP support is missing.  However, the = key  is  still
  2811. an  operator  that  reformats lines of text.  By default, it
  2812. reformats lines by sending them through the fmt filter,  but
  2813. you could write your own LISP beautifier and configure elvis
  2814. to use it.  Key mappings  could  take  care  of  most  other
  2815. differences.  Auto-indent is the only thing that is irrecov-
  2816. erably lost.
  2817.  
  2818.      Autoindent mode acts a little different from  the  real
  2819. vi, anyway.  It doesn't handle ^^D or 0^D correctly.  On the
  2820. other hand, it does allow ^D and ^T to be used  anywhere  in
  2821. the line, to adjust the indentation for the whole line.
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.                           09/23/93
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845. 8.  INTERNAL
  2846.  
  2847.      You don't need to know the material in this section  to
  2848. use Elvis.  You only need it if you intend to modify Elvis.
  2849.  
  2850.      You should also check out the CFLAGS, TERMCAP, ENVIRON-
  2851. MENT  VARIABLES, VERSIONS, and QUIESTIONS & ANSWERS sections
  2852. of this manual.
  2853.  
  2854. 8.1.  The temporary file
  2855.  
  2856.      The temporary file is divided into blocks of 1024 bytes
  2857. each.  The functions in "blk.c" maintain a cache of the five
  2858. most recently used blocks, to minimize file I/O.
  2859.  
  2860.      When Elvis starts up, the file is copied into the  tem-
  2861. porary  file  by  the function tmpstart() in "tmp.c".  Small
  2862. amounts of extra space are inserted into the temporary  file
  2863. to  insure  that no text lines cross block boundaries.  This
  2864. speeds up processing and simplifies storage management.  The
  2865. extra  space  is filled with NUL characters.  the input file
  2866. must not contain any NULs, to avoid  confusion.   This  also
  2867. limits lines to a length of 1023 characters or less.
  2868.  
  2869.      The data blocks aren't necessarily stored in  sequence.
  2870. For  example,  it  is  entirely possible that the data block
  2871. containing the first lines of text will be stored after  the
  2872. block containing the last lines of text.
  2873.  
  2874.      In RAM, Elvis maintains two lists: one  that  describes
  2875. the  "proper"  order  of  the  disk blocks, and another that
  2876. records the line number of the  last  line  in  each  block.
  2877. When  Elvis  needs  to  fetch  a given line of text, it uses
  2878. these tables to locate the data block  which  contains  that
  2879. line.
  2880.  
  2881.      Before each change is made to the file, these lists are
  2882. copied.  The copies can be used to "undo" the change.  Also,
  2883. the first list -- the one that  lists  the  data  blocks  in
  2884. their  proper order -- is written to the first data block of
  2885. the temp file.  This list can be used during file recovery.
  2886.  
  2887.      When blocks are altered, they are rewritten to  a  dif-
  2888. ferent  block  in  the  file,  and the order list is updated
  2889. accordingly.  The original block is  left  intact,  so  that
  2890. "undo"  can  be  performed  easily.   Elvis  will eventually
  2891. reclaim the original block, when it is no longer needed.
  2892.  
  2893. 8.2.  Implementation of Editing
  2894.  
  2895.      There are three basic operations which affect text:
  2896.  
  2897.         o delete text   - delete(from, to)
  2898.         o add text      - add(at, text)
  2899.  
  2900.  
  2901.  
  2902.                           09/23/93
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908. 8-2                       INTERNAL                       8-2
  2909.  
  2910.  
  2911.         o yank text     - cut(from, to)
  2912.  
  2913.  
  2914.      To yank text, all text between two  text  positions  is
  2915. copied into a cut buffer.  The original text is not changed.
  2916. To copy the text into a cut buffer, you need  only  remember
  2917. which  physical blocks that contain the cut text, the offset
  2918. into the first block of the start of  the  cut,  the  offset
  2919. into  the last block of the end of the cut, and what kind of
  2920. cut it was.  (Cuts may be  either  character  cuts  or  line
  2921. cuts;  the kind of a cut affects the way it is later "put".)
  2922. Yanking is implemented in the function cut(), and pasting is
  2923. implemented  in  the  function paste().  These functions are
  2924. defined in "cut.c".
  2925.  
  2926.      To delete text, you must  modify  the  first  and  last
  2927. blocks,  and  remove any reference to the intervening blocks
  2928. in the header's list.  The text to be deleted  is  specified
  2929. by two marks.  This is implemented in the function delete().
  2930.  
  2931.      To add text, you must specify the text to insert (as  a
  2932. NUL-terminated  string)  and  the  place  to insert it (as a
  2933. mark).  The block into which the text is to be inserted  may
  2934. need  to  be  split  into  as  many as four blocks, with new
  2935. intervening blocks needed as well...  or it could be as sim-
  2936. ple as modifying a single block.  This is implemented in the
  2937. function add().
  2938.  
  2939.      There is also a change() function, which generally just
  2940. calls delete() and add().  For the special case where a sin-
  2941. gle character is being replaced by another single character,
  2942. though,  change() will optimize things somewhat.  The add(),
  2943. delete(),  and  change()  functions  are  all   defined   in
  2944. "modify.c".
  2945.  
  2946.      The input() function reads text from a user and inserts
  2947. it  into  the  file.   It  makes  heavy  use  of  the add(),
  2948. delete(), and change() functions.  It inserts characters one
  2949. at a time, as they are typed.
  2950.  
  2951.      When  text  is  modified,  an  internal   file-revision
  2952. counter,  called  changes,  is incremented.  This counter is
  2953. used to detect when certain caches are out  of  date.   (The
  2954. "changes"  counter  is  also incremented when we switch to a
  2955. different file, and also in one or two similar situations --
  2956. all related to invalidating caches.)
  2957.  
  2958. 8.3.  Marks and the Cursor
  2959.  
  2960.      Marks are places within the text.  They are represented
  2961. internally  as  32-bit  values which are split into two bit-
  2962. fields:  a line number and a character index.  Line  numbers
  2963. start with 1, and character indexes start with 0.  Lines can
  2964. be up to 1023 characters long, so the character index is  10
  2965.  
  2966.  
  2967.  
  2968.                           09/23/93
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974. 8-3                       INTERNAL                       8-3
  2975.  
  2976.  
  2977. bits wide and the line number fills the remaining 22 bits in
  2978. the long int.
  2979.  
  2980.      Since line numbers start with 1, it is impossible for a
  2981. valid  mark  to have a value of 0L.  0L is therefore used to
  2982. represent unset marks.
  2983.  
  2984.      When you do the "delete text" change,  any  marks  that
  2985. were  part of the deleted text are unset, and any marks that
  2986. were set  to  points  after  it  are  adjusted.   Marks  are
  2987. adjusted similarly after new text is inserted.
  2988.  
  2989.      The cursor is represented as a mark.
  2990.  
  2991. 8.4.  Colon Command Interpretation
  2992.  
  2993.      Colon commands are parsed,  and  the  command  name  is
  2994. looked  up  in  an  array of structures which also contain a
  2995. pointer to the function that implements the command,  and  a
  2996. description  of the arguments that the command can take.  If
  2997. the command is recognized and its arguments are legal,  then
  2998. the function is called.
  2999.  
  3000.      Each function performs its task;  this  may  cause  the
  3001. cursor to be moved to a different line, or whatever.
  3002.  
  3003. 8.5.  Screen Control
  3004.  
  3005.      In input mode or visual command  mode,  the  screen  is
  3006. redrawn  by  a  function  called redraw().  This function is
  3007. called in the getkey() function  before  each  keystroke  is
  3008. read in, if necessary.
  3009.  
  3010.      Redraw() writes to the screen via a package which looks
  3011. like  the  "curses" library, but isn't.  It is actually much
  3012. simpler.  Most curses operations are implemented  as  macros
  3013. which copy characters into a large I/O buffer, which is then
  3014. written with a single large write()  call  as  part  of  the
  3015. refresh() operation.
  3016.  
  3017.      (Note: Under MS-DOS, the pseudo-curses macros check  to
  3018. see  whether you're using the pcbios interface.  If you are,
  3019. then the macros call functions in "pc.c" to implement screen
  3020. updates.)
  3021.  
  3022.      The  low-level  functions  which  modify  text  (namely
  3023. add(), delete(), and change()) supply redraw() with clues to
  3024. help redraw() decide which  parts  of  the  screen  must  be
  3025. redrawn.    The  clues  are  given  via  a  function  called
  3026. redrawrange().
  3027.  
  3028.      Most EX commands use the pseudo-curses package to  per-
  3029. form their output, like redraw().
  3030.  
  3031.  
  3032.  
  3033.  
  3034.                           09/23/93
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040. 8-4                       INTERNAL                       8-4
  3041.  
  3042.  
  3043.      There is also a function called msg()  which  uses  the
  3044. same  syntax  as printf().  In EX mode, msg() writes message
  3045. to the screen and automatically adds a newline.  In VI mode,
  3046. msg()  writes  the  message on the bottom line of the screen
  3047. with the "standout" character attribute turned on.
  3048.  
  3049. 8.6.  Options
  3050.  
  3051.      For each option available through the  ":set"  command,
  3052. Elvis contains a character array variable, named "o_option".
  3053. For example, the  "lines"  option  uses  a  variable  called
  3054. "o_lines".
  3055.  
  3056.      For boolean options, the array has a  dimension  of  1.
  3057. The  first  (and only) character of the array will be NUL if
  3058. the variable's value is FALSE, and some other value if it is
  3059. TRUE.   To  check  the  value, just by dereference the array
  3060. name, as in "if (*o_autoindent)".
  3061.  
  3062.      For number options, the array has  a  dimension  of  3.
  3063. The  array  is  treated as three unsigned one-byte integers.
  3064. The first byte is the current  value  of  the  option.   The
  3065. second  and  third  bytes  are the lower and upper bounds of
  3066. that option.
  3067.  
  3068.      For string options, the array usually has  a  dimension
  3069. of about 60 but this may vary.  The option's value is stored
  3070. as a normal NUL-terminated string.
  3071.  
  3072.      All of the options are declared in "opts.c".  Most  are
  3073. initialized to their default values; the initopts() function
  3074. is used to perform any environment-specific initialization.
  3075.  
  3076. 8.7.  Portability
  3077.  
  3078.      To improve portability, Elvis collects as many  of  the
  3079. system-dependent definitions as possible into the "config.h"
  3080. file.  This file begins with some preprocessor  instructions
  3081. which attempt to determine which compiler and operating sys-
  3082. tem you have.  After that,  it  conditionally  defines  some
  3083. macros and constants for your system.
  3084.  
  3085.      One of the more significant macros is ttyread().   This
  3086. macro is used to read raw characters from the keyboard, pos-
  3087. sibly with timeout.  For UNIX systems, this basically  reads
  3088. bytes  from  stdin.  For MSDOS, TOS, and OS9, ttyread() is a
  3089. function defined in curses.c.  There is  also  a  ttywrite()
  3090. macro.
  3091.  
  3092.      The tread() and twrite() macros are versions of  read()
  3093. and  write() that are used for text files.  On UNIX systems,
  3094. these are equivelent to  read()  and  write().   On  MS-DOS,
  3095. these  are  also equivelent to read() and write(), since DOS
  3096. libraries are generally clever  enough  to  convert  newline
  3097.  
  3098.  
  3099.  
  3100.                           09/23/93
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106. 8-5                       INTERNAL                       8-5
  3107.  
  3108.  
  3109. characters  automatically.   For  Atari TOS, though, the MWC
  3110. library is too stupid to do  this,  so  we  had  to  do  the
  3111. conversion explicitly.
  3112.  
  3113.      Other macros may substitute index()  for  strchr(),  or
  3114. bcopy()  for memcpy(), or map the "void" data type to "int",
  3115. or whatever.
  3116.  
  3117.      The file "tinytcap.c" contains a set of functions  that
  3118. emulate  the  termcap  library  for  a small set of terminal
  3119. types.  The terminal-specific info is hard-coded  into  this
  3120. file.   It  is only used for systems that don't support real
  3121. termcap.  Another alternative for screen control can be seen
  3122. in  the  "curses.h"  and  "pc.c"  files.  Here, macros named
  3123. VOIDBIOS and CHECKBIOS are used to indirectly call functions
  3124. which perform low-level screen manipulation via BIOS calls.
  3125.  
  3126.      The stat() function must be able to come up with  UNIX-
  3127. style  major/minor/inode  numbers  that  uniquely identify a
  3128. file or directory.
  3129.  
  3130.      Please try to keep you changes localized, and wrap them
  3131. in  #if/#endif pairs, so that Elvis can still be compiled on
  3132. other systems.  And PLEASE let me know about it,  so  I  can
  3133. incorporate your changes into my latest-and-greatest version
  3134. of Elvis.
  3135.  
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.                           09/23/93
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175. 9.  MAKEFILE
  3176.  
  3177.      On most Operating Systems, and with most compilers, the
  3178. "Makefile.mix"  file is used to control compilation and ins-
  3179. tallation of Elvis.  This section of  the  manual  describes
  3180. the  overall  structure  of  "Makefile.mix", and the various
  3181. configuration options in it.
  3182.  
  3183. 9.1.  Configuring the Makefile
  3184.  
  3185.      Begin by copying "Makefile.mix" to  "Makefile".   Never
  3186. alter the original "Makefile.mix".
  3187.  
  3188.      Most of the configuration options are controlled via  a
  3189. group  of  macros.   Makefile.mix  begins  with several pre-
  3190. configured sets of macro definitions - one group for each of
  3191. the most common supported systems.  As shipped, all of these
  3192. macro definitions are commented out; you must either  uncom-
  3193. ment  out  one  of  the groups, or (for less common systems)
  3194. construct an entirely new group.
  3195.  
  3196. 9.2.  Using the Makefile
  3197.  
  3198.      After configuring the Makefile, you can run  "make"  to
  3199. compile  the  programs.   There  are  also some other useful
  3200. things that the Makefile can do...
  3201.  
  3202.           COMMAND     RESULT
  3203.           make        compile all programs
  3204.           make installcopy the programs to the BIN directory
  3205.           make clean  remove all object files
  3206.           make clobberremove everything except source & documentation
  3207.           make uue    produce uuencoded compressed tar archives of the source
  3208.           make sh     produce shar archives of the source
  3209.  
  3210.  
  3211.      Note that the last two will probably  work  only  under
  3212. UNIX.
  3213.  
  3214. 9.3.  What "make install" does
  3215.  
  3216.      To install elvis, we should copy all of the executables
  3217. into  a  directory where users can find them; copy the docu-
  3218. mentation into a directory where the on-line manual  program
  3219. can  find them; and arrange for edit buffers to be preserved
  3220. after a system crash.  The "make install" command  tries  to
  3221. do this automatically, but there are problems.
  3222.  
  3223.      Practically all operating systems allow programs to  be
  3224. installed  different  directories.  As shipped, Makefile.mix
  3225. contains somebody's best guess as to where you'd  like  them
  3226. to  go.   You should double check it, though.  The BIN macro
  3227. controls where the programs will be installed.
  3228.  
  3229.  
  3230.  
  3231.  
  3232.                           09/23/93
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238. 9-2                       MAKEFILE                       9-2
  3239.  
  3240.  
  3241.      On UNIX systems the  "elvprsv"  and  "elvrec"  programs
  3242. need  to  be installed as SUID-root programs.  Consequently,
  3243. you must run "make install" as root; then they will automat-
  3244. ically be installed as SUID-root.
  3245.  
  3246.      For text to be recovered after a  crash,  you  need  to
  3247. arrange  for the "elvprsv" program to be run before the /tmp
  3248. file is cleaned.  This means that the /etc/rc file (or what-
  3249. ever)  needs  to  be edited.  If you have a SysV UNIX system
  3250. which uses a /etc/rc2.d directory for storing start-up  com-
  3251. mands,  then  you're lucky.  "make install" will detect that
  3252. /etc/rc2.d exists and attempt to automatically create a file
  3253. called  "/etc/rc2.d/S03elvis"  which runs elvprsv.  However,
  3254. for non-UNIX systems, or UNIX systems  which  don't  have  a
  3255. /etc/rc2.d  directory,  you'll need to do this by hand.  See
  3256. the "Versions" section of the manual for hints  about  doing
  3257. this on your particular system.
  3258.  
  3259.      Non-UNIX systems don't  have  a  standard  place  where
  3260. UNIX-style  man-pages  go, so "make install" doesn't attempt
  3261. to install documentation on those systems.
  3262.  
  3263.      On UNIX systems, there is no standard place either, but
  3264. you  can  be pretty sure that your system has a non-standard
  3265. one.  There is a  shell  script  called  "instman.sh"  which
  3266. attempts  to  figure  out where the man-pages belong on your
  3267. system, and then copies them there.  You might need to  edit
  3268. "instman.sh"  to  make  it  work,  but  try  it as-is first.
  3269. "instman.sh" is automatically run by "make install".
  3270.  
  3271.      Note: It is safe to run "make install" more than once.
  3272.  
  3273. 9.4.  Summary of Macros
  3274.  
  3275.      The following describes the configuration macros.  With
  3276. most  versions  of  make,  a  blank macro can simply be left
  3277. undefined.
  3278.  
  3279. OBJ  This is the  filename  extension  for  unlinked  object
  3280.      files - usually .o, but MS-DOS uses .obj.
  3281.  
  3282. EXE  This is the filename  extension  for  elvis  executable
  3283.      file - usually nothing, but MS-DOS uses .exe, and other
  3284.      operating systems may use something else.
  3285.  
  3286. COM  This is the filename extension for the  executables  of
  3287.      elvis'  support  programs - usually the same as the EXE
  3288.      macro, but since the  support  programs  are  all  much
  3289.      smaller that elvis, MS-DOS can use the .com format.
  3290.  
  3291. EXTRAThis is  a  space-delimited  list  of  version-specific
  3292.      object  files to be linked into elvis.  Typically, this
  3293.      list will contain at least one object  file  which  was
  3294.      written  specifically for a given operating system.  It
  3295.  
  3296.  
  3297.  
  3298.                           09/23/93
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304. 9-3                       MAKEFILE                       9-3
  3305.  
  3306.  
  3307.      may also contain "tinytcap$(OBJ)" or "tinyprnt$(OBJ)".
  3308.  
  3309. EXTRA2This is a  space-delimited  list  of  version-specific
  3310.      object  files  used  in  elvis and a few of the support
  3311.      programs.  For UNIX-like systems, this is typically  an
  3312.      empty  list.   For  non-UNIX  systems,  it will usually
  3313.      either be empty, or it will  contain  the  name  of  an
  3314.      object file which contains functions which emulate cer-
  3315.      tain UNIX system calls.  (Not all non-UNIX systems need
  3316.      any   special   emulation   functions,  because  all  C
  3317.      libraries try to emulate UNIX.  You only need an EXTRA2
  3318.      list if the library doesn't emulate UNIX well enough.)
  3319.  
  3320. LIBS This is a list of  library  flags  used  while  linking
  3321.      elvis.   UNIX  systems  need  "-ltermcap"  or something
  3322.      similar,    unless    the    EXTRA    macro    includes
  3323.      "tinytcap$(OBJ)".   Most  other  operating  systems use
  3324.      "tinytcap$(OBJ)" and don't need anything else, so  they
  3325.      leave the LIBS list empty.
  3326.  
  3327. BIN  This is  the  directory  where  executables  should  be
  3328.      installed by "make install".
  3329.  
  3330. CC   This is the C compiler command, possibly  with  "memory
  3331.      model" flags.
  3332.  
  3333. CFLAGSThis lists the compiler flags used to select  compile-
  3334.      time  options.   The  "CFLAGS"  section  of this manual
  3335.      describes this in detail.
  3336.  
  3337. LNK  This is the name of the linker.  If  you  want  to  use
  3338.      $(CC) as your linker, then you can leave LNK undefined.
  3339.  
  3340. LFLAGSThis is a list of linker flags used  to  select  link-
  3341.      time options.  It is almost always blank.
  3342.  
  3343. SMALLThe flag for special small memory model  compilation  -
  3344.      usually blank.
  3345.  
  3346. OF   The link flag to control the output file's name -  usu-
  3347.      ally  -o<space>.   The Sun version of "make" strips off
  3348.      trailing whitespace, so a pair of empty quotes has been
  3349.      added  after  the  space,  to protect it.  On non-Suns,
  3350.      this isn't necessary.
  3351.  
  3352. RF   The flag used to denote "compile but don't link" - usu-
  3353.      ally -c
  3354.  
  3355. PROGSThis is a space-delimited list of all  programs.   This
  3356.      list  always  includes  elvis,  ctags, ref, elvrec, and
  3357.      elvprsv.  Also, everybody gets fmt except for BSD UNIX;
  3358.      it  already  has  its  own  version  of fmt as standard
  3359.      equipment.
  3360.  
  3361.  
  3362.  
  3363.  
  3364.                           09/23/93
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370. 9-4                       MAKEFILE                       9-4
  3371.  
  3372.  
  3373.      Most non-UNIX systems also include the vi, ex, and view
  3374.      aliases.  (UNIX doesn't need those aliases in the PROGS
  3375.      list because it creates them via file links during ins-
  3376.      tallation.)  OS-9 doesn't include the ex alias, because
  3377.      there is already a command by that name built into  its
  3378.      standard shell.
  3379.  
  3380.      Note: some MS-DOS configurations break this  list  into
  3381.      two  smaller  lists, to compensate for MS-DOS's limita-
  3382.      tions on command line length.
  3383.  
  3384. CHMEMThis is either blank, or a command to  be  run  immedi-
  3385.      ately  after  linking elvis.  Under Minix and Coherent,
  3386.      elvis needs to have extra space assigned for the  stack
  3387.      &  heap  after it has been linked, so their commands to
  3388.      do that are placed here.  Most other operating  systems
  3389.      generally  either  don't  need  to  have  their  stacks
  3390.      enlarged, or they enlarge it during linking.
  3391.  
  3392. SORT This should be defined to be -DSORT if  you  want  your
  3393.      tags  list  to  be  sorted,  or  blank  if  you want it
  3394.      unsorted.  The real vi requires a sorted tags file,  so
  3395.      for  the  sake  of compatibility all of the UNIX confi-
  3396.      gurations use -DSORT.  Elvis doesn't need a sorted tags
  3397.      file, though, so on non-UNIX systems you can leave this
  3398.      macro blank.
  3399.  
  3400. RM   This is the name of a program that deletes files uncon-
  3401.      ditionally.   It  is  used  during "make clean".  RM is
  3402.      defined as "rm -f" for UNIX systems, or "del" for  most
  3403.      others.
  3404.  
  3405. CP   This is the name of a program  that  copies  files.   -
  3406.      usually  "cp"  or  "copy".   It  is  used  during "make
  3407.      install".
  3408.  
  3409. SYS  This is the type of system.  It is used  to  select  an
  3410.      appropriate  style of linking and installation that are
  3411.      used by "make" and "make install",  respectively.   The
  3412.      available types are:
  3413.  
  3414.                          unx       UNIX and UNIX-like systems
  3415.                          dos       MS-DOS
  3416.                          ami       AmigaDos
  3417.                          tos       Atari TOS
  3418.                          os9       OS-9/68k
  3419.                          vms       VAX/VMS
  3420.                          xdos      cross-compiled on SCO for MS-DOS
  3421.  
  3422.  
  3423. DUMMYThis is used as the "source" filename in the dependency
  3424.      list  of  targets which are supposed to be uncondition-
  3425.      ally compiled.  It is usually nothing since  most  ver-
  3426.      sions  of  "make"  treat an empty source file list as a
  3427.  
  3428.  
  3429.  
  3430.                           09/23/93
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436. 9-5                       MAKEFILE                       9-5
  3437.  
  3438.  
  3439.      special case, but OS-9 needs it defined as "dummy"  and
  3440.      further  requires  that  there  be no actual file named
  3441.      dummy.
  3442.  
  3443. CFG  The is the name of the compiler  configuration  file  -
  3444.      usually blank, since most compilers don't need a confi-
  3445.      guration file.  Some MS-DOS compilers need it, though.
  3446.  
  3447. 9.5.  Structure of Makefile.mix
  3448.  
  3449.      Makefile.mix begins with several sets of commented  out
  3450. configuration macro definitions, as described above.  A com-
  3451. ment saying "The rest of this  Makefile  contains  no  user-
  3452. serviceable parts" marks the end of this section.  Most peo-
  3453. ple won't need to edit anything after that.
  3454.  
  3455.      This is followed by macro definitions which are identi-
  3456. cal,  regardless  of your operating system.  The OBJS macros
  3457. list the object files that form the portable parts of elvis,
  3458. and  are  used together with the EXTRA and EXTRA2 configura-
  3459. tion macros during linking.
  3460.  
  3461.      The SRC macros list all of the files mentioned  in  the
  3462. "MANIFEST"  file.   These are used to bundle the source code
  3463. via "make uue" or "make sh".
  3464.  
  3465.      This is followed by a target named "all" which  depends
  3466. on  all  of  the  programs listed in the PROGS configuration
  3467. macro.  This is followed by detailed instructions describing
  3468. how  each  file is compiled and linked.  The only exceptions
  3469. are the "elvis"  program,  and  the  various  forms  of  the
  3470. "alias" program.
  3471.  
  3472.      Linking a big program like  elvis  is  non-standard  on
  3473. some  systems.   To  support  this,  we  just say that elvis
  3474. depends on "linkelv.$(SYS)", where "$(SYS)" is  replaced  by
  3475. whatever you defined the SYS configuration macro to be.  The
  3476. various link styles are listed after that.  The only  really
  3477. tricky one is for DOS.  Since the list of files to be linked
  3478. is too long to fit on  a  DOS  command  line,  a  customized
  3479. response  file is created, and the name of the response file
  3480. is passed instead.  The exact format of  the  response  file
  3481. depends on the compiler you're using.
  3482.  
  3483.      This is followed by system-dependent  ways  of  linking
  3484. the "alias" object file to create multiple executables.  For
  3485. most systems, we only really link it once to form  the  "ex"
  3486. executable,  and then copy that executable to form the "vi",
  3487. "view", and "input" executables.  OS-9, though, doesn't need
  3488. an  "ex"  executable and it requires actual linking for each
  3489. alias.
  3490.  
  3491.      Next comes installation, in all  its  system  dependent
  3492. forms.   This uses the now-familiar trick of saying that the
  3493.  
  3494.  
  3495.  
  3496.                           09/23/93
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502. 9-6                       MAKEFILE                       9-6
  3503.  
  3504.  
  3505. "install" target depends on a bogus file named "inst.$(SYS)"
  3506. and  then  listing  each  installation technique after that.
  3507. There should be no surprises here.
  3508.  
  3509.      The rest of Makefile.mix contains a few  handy  pseudo-
  3510. targets, such as "make clean".
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.                           09/23/93
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571. 10.  CFLAGS
  3572.  
  3573.      Elvis uses many preprocessor symbols to control  compi-
  3574. lation.   Some  of  these  control  the sizes of buffers and
  3575. such.  The "-DNO_XXXX" options remove small sets of  related
  3576. features.
  3577.  
  3578.      Most  Elvis  users  will  probably  want  to  keep  all
  3579. features  available.   Minix-PC  users, though, will have to
  3580. sacrifice some sets because otherwise  Elvis  would  be  too
  3581. bulky  to  compile.   The "asld" phase of the compiler craps
  3582. out.
  3583.  
  3584. -DM_SYSV, -Dbsd, -DTOS, -DCOHERENT, -Damiga
  3585.      These flags tell the compiler that Elvis is being  com-
  3586.      piled for System-V UNIX, BSD UNIX, Atari TOS, Coherent,
  3587.      or AmigaDos,  respectively.   For  other  systems,  the
  3588.      config.h  file  can  generally  figure it out automati-
  3589.      cally.
  3590.  
  3591. -DRAINBOW
  3592.      For MS-DOS systems, this causes  support  for  the  DEC
  3593.      Rainbow to be compiled into Elvis.
  3594.  
  3595. -DNO_S5WINSIZE
  3596.      Some versions of SysV UNIX don't  support  support  the
  3597.      "winsize"  style of screen-size testing.  If you have a
  3598.      SysV system and  can't  compile  "curses.c",  then  try
  3599.      adding -DNO_S5WINSIZE to the CFLAGS.
  3600.  
  3601. -DTERMIOS
  3602.      POSIX is a SysV-derived specification which uses a ter-
  3603.      minal  control  package  called  "termios",  instead of
  3604.      "termio".  Some other SysV systems may  also  use  ter-
  3605.      mios.   You  can make elvis uses termios instead of the
  3606.      more common  termio  by  adding  -DTERMIOS  to  CFLAGS.
  3607.      (Note: This hasn't been tested very well.)
  3608.  
  3609. -DNBUFS=number
  3610.      Elvis keeps most of your text in a temporary file; only
  3611.      a  small  amount  is actually stored in RAM.  This flag
  3612.      allows you to control how much of the file  can  be  in
  3613.      RAM  at  any  time.   The  default is 5 blocks, and the
  3614.      minimum is 3 blocks.  (See the -DBLKSIZE flag, below.)
  3615.  
  3616.      More RAM allows global changes to happen a little  fas-
  3617.      ter.   If  you're just making many small changes in one
  3618.      section of a file, though, extra RAM won't help much.
  3619.  
  3620. -DBLKSIZE=number
  3621.      This controls the size of blocks that Elvis uses inter-
  3622.      nally.   The  value  of BLKSIZE must be a power of two.
  3623.      Every time you double BLKSIZE, you quadruple  the  size
  3624.      of  a  text  file  that  Elvis can handle, but you also
  3625.  
  3626.  
  3627.  
  3628.                           09/23/93
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634. 10-2                       CFLAGS                       10-2
  3635.  
  3636.  
  3637.      cause the temporary file to grow faster.   For  MS-DOS,
  3638.      Coherent,  and  Minix-PC,  the  default  value is 1024,
  3639.      which allows you to edit files up to almost 512K  bytes
  3640.      long.   For  all  other  systems,  the default value is
  3641.      2048, which allows you to edit files that are nearly  2
  3642.      megabytes long.
  3643.  
  3644.      The BLKSIZE also determines the  maximum  line  length,
  3645.      and  a few other limits.  BLKSIZE should be either 256,
  3646.      512, 1024, or 2048.  Values other than these  can  lead
  3647.      to strange behaviour.
  3648.  
  3649. -DTMPDIR=string
  3650.      This sets the default value of the "directory"  option,
  3651.      which   specifies  where  the  temporary  files  should
  3652.      reside.  The value of TMPDIR must be a  string,  so  be
  3653.      sure  your  value includes the quote characters on each
  3654.      end.
  3655.  
  3656. -DEXRC=str, -DHMEXRC=str, -DSYSEXRC=str, -DEXINIT=str
  3657.      This lets you control the names of  the  initialization
  3658.      files.   Their  values  must  be strings, so be careful
  3659.      about quoting.
  3660.  
  3661.      EXRC is the name of  the  initialization  file  in  the
  3662.      current  directory.   Its  default  value is ".exrc" on
  3663.      UNIX systems -- the same as the real  vi.   Since  that
  3664.      isn't  a  legal  DOS filename, under DOS the default is
  3665.      "elvis.rc".  For  other  systems,  check  the  config.h
  3666.      file.
  3667.  
  3668.      HMEXRC is the name of the initialization file  in  your
  3669.      home  directory.   By  default, it is the same as EXRC.
  3670.      Elvis will automatically prepend the name of your  home
  3671.      directory  to  HMEXRC at run time, so don't give a full
  3672.      path name.
  3673.  
  3674.      SYSEXRC is the name  of  a  system-wide  initialization
  3675.      file.   It  has no default value; if you don't define a
  3676.      value for it, then the code that supports SYSEXRC  just
  3677.      isn't  compiled.  The value of SYSEXRC should be a full
  3678.      pathname, in quotes.
  3679.  
  3680.      EXINIT is the name of an environment variable that  can
  3681.      contain  initialization  commands.  Normally, its value
  3682.      is "EXINIT".
  3683.  
  3684. -DKEYWORDPRG=string
  3685.      This  flag  determines  the  default   value   of   the
  3686.      "keywordprg" option.  Its value must be a string, so be
  3687.      careful about quoting.  The default value of this  flag
  3688.      is "ref", which is a C reference program.
  3689.  
  3690. -DCC_COMMAND=string -DMAKE_COMMAND=string -DERRLIST=string
  3691.  
  3692.  
  3693.  
  3694.                           09/23/93
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700. 10-3                       CFLAGS                       10-3
  3701.  
  3702.  
  3703.      These control the names of the C compiler,  the  "make"
  3704.      utility, and the error output file, respectively.  They
  3705.      are only used if -DNO_ERRLIST is not given.
  3706.  
  3707.      The default value of CC_COMMAND depends on the  Operat-
  3708.      ing  System and compiler that you use to compile elvis;
  3709.      for UNIX, the default is "cc".  The default  values  of
  3710.      MAKE_COMMAND  and  ERRLIST  are  "make"  and "errlist",
  3711.      respectively.
  3712.  
  3713. -DMAXRCLEN=number
  3714.      This determines how large a :@  macro  command  can  be
  3715.      (measured  in  bytes).   The default is 1000 bytes.  If
  3716.      you increase this value  significantly,  then  you  may
  3717.      need  to  allocate extra memory for the stack.  See the
  3718.      "CHMEM" setting in the Makefile.
  3719.  
  3720. -DSHELL=string
  3721.      This is the default value of the  "shell"  option,  and
  3722.      hence  the  default shell used from within Elvis.  This
  3723.      only controls the default; the value you give here  may
  3724.      be  overridden  at  run-time  by setting an environment
  3725.      variable named SHELL  (or  COMSPEC  for  MS-DOS).   Its
  3726.      value  must  be  a string constant, so be careful about
  3727.      quoting.
  3728.  
  3729. -DMAILER=string
  3730.      This is the name of the program that Elvis uses to send
  3731.      mail  to  a  user  whose  text has just been preserved.
  3732.      (See the manual page for the elvprsv program.)  If your
  3733.      system doesn't use electronic mail, then this option is
  3734.      irrelevent.  For UNIX and  OS-9  systems,  though,  the
  3735.      value  should be a quoted string.  The default value is
  3736.      "mail", but SysV users may prefer to use  "mailx",  and
  3737.      BSD users may prefer "Mail".
  3738.  
  3739. -DTAGS=string
  3740.      This sets the name of the "tags" file, which is used by
  3741.      the :tag command.  Its value must be a string constant,
  3742.      so be careful about quoting.
  3743.  
  3744. -DCS_IBMPC -DCS_LATIN1 -DCS_SPECIAL
  3745.      The digraph table and  flipcase  option  will  normally
  3746.      start  out  empty.   However,  if you add -DCS_IBMPC or
  3747.      -DCS_LATIN1 to your CFLAGS, then they  will  start  out
  3748.      filled  with values that are appropriate for the IBM PC
  3749.      character set or the ISO Latin-1 character set, respec-
  3750.      tively.
  3751.  
  3752.      You can also use -DCS_IBMPC and  -DCS_SPECIAL  together
  3753.      to  get  digraphs that produce the PC's graphic charac-
  3754.      ters.
  3755.  
  3756. -DDEBUG -DEBUG2
  3757.  
  3758.  
  3759.  
  3760.                           09/23/93
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766. 10-4                       CFLAGS                       10-4
  3767.  
  3768.  
  3769.      -DDEBUG adds the ":debug" and ":validate" commands, and
  3770.      also   adds   many  internal  consistency  checks.   It
  3771.      increases the size of the ".text" segment by about 6K.
  3772.  
  3773.      -DDEBUG2 causes a line to be appended to a file  called
  3774.      "debug.out"  everytime  any  change is made to the edit
  3775.      buffer.
  3776.  
  3777. -DCRUNCH
  3778.      This flag removes some non-critical code, so that Elvis
  3779.      is  smaller.   For example, it removes a short-cut from
  3780.      the regexp package, so that text searches  are  slower.
  3781.      Also, screen updates are not as efficient.  A couple of
  3782.      obscure features are disabled by this, too.
  3783.  
  3784. -DNO_MKEXRC
  3785.      This removes the ":mkexrc"  command,  so  you  have  to
  3786.      create any .exrc files manually.  The size of the .text
  3787.      segment will be reduced by about 1500 bytes.
  3788.  
  3789. -DNO_CHARATTR
  3790.      Permanently disables the charattr option.  This reduces
  3791.      the size of your ".text" segment by about 850 bytes.
  3792.  
  3793. -DNO_RECYCLE
  3794.      Normally, Elvis will recycle space (from the  temporary
  3795.      file)  which contains totally obsolete text.  This flag
  3796.      disables  this  recycling.   Without   recycling,   the
  3797.      ".text"  segment is about 1K smaller than it would oth-
  3798.      erwise be, but the tmp file grows much faster.  If  you
  3799.      have  a  lot of free space on your hard disk, but Elvis
  3800.      is too bulky to run with recycling, then try it without
  3801.      recycling.
  3802.  
  3803.      When using a version of Elvis that  has  been  compiled
  3804.      with  -DNO_RECYCLE, you should be careful to avoid mak-
  3805.      ing many small changes to a file because  each  indivi-
  3806.      dual change will cause the tmp file to grow by at least
  3807.      1k.  Hitting "x" thirty times counts as thirty changes,
  3808.      but  typing  "30x"  counts  as  one  change.  Also, you
  3809.      should occasionally do a ":w" followed  by  a  ":e"  to
  3810.      start with a fresh tmp file.
  3811.  
  3812.      Interestingly, the real vi never  recycles  space  from
  3813.      its temporary file.
  3814.  
  3815. -DNO_SENTENCE
  3816.      Leaves out the "(" and ")" visual mode commands.  Also,
  3817.      the  "[[",  "]]", "{", and "}" commands will not recog-
  3818.      nize *roff macros.  The sections and paragraphs options
  3819.      go  away.   This  saves  about 650 bytes in the ".text"
  3820.      segment.
  3821.  
  3822. -DNO_CHARSEARCH
  3823.  
  3824.  
  3825.  
  3826.                           09/23/93
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832. 10-5                       CFLAGS                       10-5
  3833.  
  3834.  
  3835.      Leaves out the visual commands  which  locate  a  given
  3836.      character in the current line:  "f", "t", "F", "T", ","
  3837.      and ";".  This saves about 900 bytes.
  3838.  
  3839. -DNO_EXTENSIONS
  3840.      Leaves out the "K" and "#" visual commands.  Also,  the
  3841.      arrow  keys will no longer work in input mode.  Regular
  3842.      expressions will no longer recognize the \{\} operator.
  3843.      (Other  extensions are either inherent in the design of
  3844.      Elvis, or are controlled by more specific flags, or are
  3845.      too  tiny  to be worth removing.)  This saves about 250
  3846.      bytes.
  3847.  
  3848. -DNO_MAGIC
  3849.      Permanently disables the "magic" option, so  that  most
  3850.      meta-characters  in  a  regular  expression  are  *NOT*
  3851.      recognized.  This  saves  about  3k  of  space  in  the
  3852.      ".text" segment, because the complex regular expression
  3853.      code can be replaced by much simpler code.
  3854.  
  3855. -DNO_SHOWMODE
  3856.      Permanently  disables  the  "showmode"  option,  saving
  3857.      about 250 bytes.
  3858.  
  3859. -DNO_CURSORSHAPE
  3860.      Normally, Elvis tries to adjust the shape of the cursor
  3861.      as   a   reminder   of   which  mode  you're  in.   The
  3862.      -DNO_CURSORSHAPE flag disables this, saving  about  150
  3863.      bytes.
  3864.  
  3865. -DNO_DIGRAPH
  3866.      To allow entry of non-ASCII characters, Elvis  supports
  3867.      digraphs.   A digraph is a single (non-ASCII) character
  3868.      which is entered as a combination of two other  (ASCII)
  3869.      characters.  If you don't need to input non-ASCII char-
  3870.      acters, or if your keyboard supports a  better  way  of
  3871.      entering non-ASCII characters, then you can disable the
  3872.      digraph code and save about 450 bytes.
  3873.  
  3874. -DNO_ERRLIST
  3875.      Elvis adds a ":errlist" command,  which  is  useful  to
  3876.      programmers.   If  you don't need this feature, you can
  3877.      disable it via the -DNO_ERRLIST flag.  This will reduce
  3878.      the .text segment by about 900 bytes, and the .bss seg-
  3879.      ment by about 300 bytes.
  3880.  
  3881. -DNO_ABBR
  3882.      The -DNO_ABBR flag disables the  ":abbr"  command,  and
  3883.      reduces the size of Elvis by about 250 bytes.
  3884.  
  3885. -DNO_OPTCOLS
  3886.      When Elvis displays the current  options  settings  via
  3887.      the  ":set"  command,  the  options are normally sorted
  3888.      into columns.  The -DNO_OPTCOLS flag causes the options
  3889.  
  3890.  
  3891.  
  3892.                           09/23/93
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898. 10-6                       CFLAGS                       10-6
  3899.  
  3900.  
  3901.      to be sorted across the rows, which is much simpler for
  3902.      the computer.  The -DNO_OPTCOLS flag  will  reduce  the
  3903.      size of your .text segment by about 500 bytes.
  3904.  
  3905. -DNO_MODELINES
  3906.      This removes all support for modelines.
  3907.  
  3908. -DNO_TAG
  3909.      This disables tag lookup.  It reduces the size  of  the
  3910.      .text segment by about 750 bytes.
  3911.  
  3912. -DNO_TAGSTACK
  3913.      This disables the tagstack.  The ^T and  :pop  commands
  3914.      will no longer be available.
  3915.  
  3916. -DNO_ALT_FKEY, -DNO_CTRL_FKEY, -DNO_SHIFT_FKEY, -DNO_FKEY
  3917.      These remove explicit  support  of  function  keys.   -
  3918.      DNO_ALT_FKEY  removes  support for the <alternate> ver-
  3919.      sions function keys.   -DNO_CTRL_FKEY  removes  support
  3920.      for  the  <control>  and  <alternate> versions function
  3921.      keys.  -DNO_SHIFT_FKEY removes support for the <shift>,
  3922.      <control>,  and  <alternate> versions function keys.  -
  3923.      DNO_FKEY removes all support of function keys.
  3924.  
  3925.      Elvis's ":map" command normally allows you to  use  the
  3926.      special  sequence  "#<n>" to map function key <n>.  For
  3927.      example, ":map #1 {!}fmt^M" will cause the <F1> key  to
  3928.      reformat  a paragraph.  Elvis checks the :k1=: field in
  3929.      the termcap description of your terminal to figure  out
  3930.      what  code  is  sent  by  the  <F1> key.  This is handy
  3931.      because it allows you to create a .exrc file which maps
  3932.      function  keys  the same way regardless of what type of
  3933.      terminal you use.
  3934.  
  3935.      That behaviour is standard; most implementations of the
  3936.      real  vi  supports it too.  Elvis extends this to allow
  3937.      you to use "#1s" to refer  to  <shift>+<F1>,  "#1c"  to
  3938.      refer   to   <control>+<F1>,  and  "#1a"  to  refer  to
  3939.      <alt>+<F1>.  The termcap description for  the  terminal
  3940.      should have fields named :s1=:c1=:a1=: respectively, to
  3941.      define the code sent by these key  conbinations.   (You
  3942.      should  also  have  :k2=:s2=:c2=:a2=: for the <F2> key,
  3943.      and so on.)
  3944.  
  3945.      But there  may  be  problems.   The  terminfo  database
  3946.      doesn't  support :s1=:c1=:a1=:, so no terminfo terminal
  3947.      description could ever support shift/control/alt  func-
  3948.      tion  keys; so you might as well add -DNO_SHIFT_FKEY to
  3949.      CFLAGS if you're using terminfo.
  3950.  
  3951.      Note that, even if you have -DNO_FKEYS, you  can  still
  3952.      configure  Elvis  to  use your function keys my mapping
  3953.      the literal character codes sent by the key.  You  just
  3954.      couldn't do it in a terminal-independent way.
  3955.  
  3956.  
  3957.  
  3958.                           09/23/93
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964. 10-7                       CFLAGS                       10-7
  3965.  
  3966.  
  3967. -DTERM_925, -DTERM_AMIGA, -DTERM_VT100, -DTERM_VT52, etc.
  3968.      The tinytcap.c file contains  descriptions  of  several
  3969.      terminal  types.  For each system that uses tinytcap, a
  3970.      reasonable subset  of  the  available  descriptions  is
  3971.      actually  compiled  into Elvis.  If you wish to enlarge
  3972.      this  subset,  then  you  can   add   the   appropriate
  3973.      -DTERM_XXX flag to your CFLAGS settings.
  3974.  
  3975.      For a list of the available terminal types,  check  the
  3976.      tinytcap.c file.
  3977.  
  3978. -DINTERNAL_TAGS
  3979.      Normally, Elvis uses the "ref" program to  perform  tag
  3980.      lookup.   This  is more powerful than the real vi's tag
  3981.      lookup, but it can be much slower.
  3982.  
  3983.      If you add -DINTERNAL_TAGS to your CFLAGS setting, then
  3984.      Elvis  will use its own internal tag lookup code, which
  3985.      is faster.
  3986.  
  3987. -DPRSVDIR=directory
  3988.      This controls where preserved files will be placed.  An
  3989.      appropriate  default has been chosen for each Operating
  3990.      System, so you probably don't need to worry about it.
  3991.  
  3992. -DFILEPERMS=number
  3993.      This affects the attributes of files that  are  created
  3994.      by  Elvis;  it  is  used  as the second argument to the
  3995.      creat() function.  The default is 0666 which  (on  UNIX
  3996.      systems  at least) means that anybody can read or write
  3997.      the new file, but nobody can execute it.  On UNIX  sys-
  3998.      tems, the creat() call modifies this via the umask set-
  3999.      ting.
  4000.  
  4001. -DKEYBUFSIZE=number
  4002.      This determines the size of the type-ahead buffer  that
  4003.      elvis uses.  It also limits the size of keymaps that it
  4004.      can handle.  The  default  is  1000  characters,  which
  4005.      should be plenty.
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.                           09/23/93
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033. 11.  TERMCAP
  4034.  
  4035.      Elvis uses fairly  standard  termcap  fields  for  most
  4036. things.   I  invented the cursor shape names and some of the
  4037. function key names, but other than that there should be  few
  4038. surprises.
  4039.  
  4040. Required numeric fields
  4041.  
  4042.         :co#:       number of columns on the screen (chars per line)
  4043.         :li#:       number of lines on the screen
  4044.  
  4045.  
  4046. Required string fields
  4047.  
  4048.         :ce=:       clear to end-of-line
  4049.         :cl=:       home the cursor & clear the screen
  4050.         :cm=:       move the cursor to a given row/column
  4051.         :up=:       move the cursor up one line
  4052.  
  4053.  
  4054. Boolean fields
  4055.  
  4056.         :am:        auto margins - wrap when char is written in last column?
  4057.         :xn:        brain-damaged auto margins - newline ignored after wrap
  4058.         :pt:        physical tabs?
  4059.  
  4060.  
  4061. Optional string fields
  4062.  
  4063.         :al=:       insert a blank row on the screen
  4064.         :dl=:       delete a row from the screen
  4065.         :cd=:       clear to end of display
  4066.         :ei=:       end insert mode
  4067.         :ic=:       insert a blank character
  4068.         :im=:       start insert mode
  4069.         :dc=:       delete a character
  4070.         :sr=:       scroll reverse (insert row at top of screen)
  4071.         :vb=:       visible bell
  4072.         :ks=:       keypad enable
  4073.         :ke=:       keypad disable
  4074.         :ti=:       terminal initialization string, to start full-screen mode
  4075.         :te=:       terminal termination, to end full-screen mode
  4076.  
  4077.  
  4078. Optional strings received from the keyboard
  4079.  
  4080.         :kd=:       sequence sent by the <down arrow> key
  4081.         :kl=:       sequence sent by the <left arrow> key
  4082.         :kr=:       sequence sent by the <right arrow> key
  4083.         :ku=:       sequence sent by the <up arrow> key
  4084.         :kP=:       sequence sent by the <PgUp> key
  4085.         :kN=:       sequence sent by the <PgDn> key
  4086.         :kh=:       sequence sent by the <Home> key
  4087.  
  4088.  
  4089.  
  4090.                           09/23/93
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096. 11-2                      TERMCAP                       11-2
  4097.  
  4098.  
  4099.         :kH=:       sequence sent by the <End> key
  4100.         :kI=:       sequence sent by the <Insert> key
  4101.  
  4102.  
  4103.      Originally, termcap  didn't  have  any  names  for  the
  4104. <PgUp>,  <PgDn>, <Home>, and <End> keys.  Although the capa-
  4105. bility names shown in the table above are the  most  common,
  4106. they  are  not  universal.  SCO Xenix uses :PU=:PD=:HM=:EN=:
  4107. for those keys.  Also, if the four arrow keys happen  to  be
  4108. part  of  a  3x3 keypad, then the five non-arrow keys may be
  4109. named :K1=: through :K5=:, so an  IBM  PC  keyboard  may  be
  4110. described  using those names instead.  Elvis can find any of
  4111. these names.
  4112.  
  4113. Optional strings sent by function keys
  4114.  
  4115.         :k1=:...:k9=:k0=:   codes sent by <F1> through <F10> keys
  4116.         :s1=:...:s9=:s0=:   codes sent by <Shift F1> ... <Shift F10>
  4117.         :c1=:...:c9=:c0=:   codes sent by <Ctrl F1> ... <Ctrl F10>
  4118.         :a1=:...:a9=:a0=:   codes sent by <Alt F1> ... <Alt F10>
  4119.  
  4120.  
  4121.      Note that :k0=: is used  to  describe  the  <F10>  key.
  4122. Some  termcap  documents  recommend  :ka=: or even :k;=: for
  4123. describing the <F10> key, but Elvis doesn't support that.
  4124.  
  4125.      Also, the :s1=:..., :c1=:..., and  :a1=:...  codes  are
  4126. very  non-standard.   The  terminfo  library doesn't support
  4127. them.  Consequently, if you're using  the  terminfo  library
  4128. then  you  might  as well add -DNO_SHIFT_FKEY to your CFLAGS
  4129. setting.
  4130.  
  4131. Optional fields that describe character attributes
  4132.  
  4133.         :so=:se=:   start/end standout mode (We don't care about :sg#:)
  4134.         :us=:ue=:   start/end underlined mode
  4135.         :md=:me=:   start/end boldface mode
  4136.         :as=:ae=:   start/end alternate character set (italics)
  4137.         :ug#:       visible gap left by :us=:ue=:md=:me=:as=:ae=:
  4138.  
  4139.  
  4140. Optional fields that affect the cursor's shape
  4141.  
  4142.      The :cQ=: string is used by  Elvis  immediately  before
  4143. exiting  to  undo  the  effects  of  the  other cursor shape
  4144. strings.  If :cQ=: is not given, then all other cursor shape
  4145. strings are ignored.
  4146.  
  4147.         :cQ=:       normal cursor
  4148.         :cX=:       cursor used for reading EX command
  4149.         :cV=:       cursor used for reading VI commands
  4150.         :cI=:       cursor used during VI input mode
  4151.         :cR=:       cursor used during VI replace mode
  4152.  
  4153.  
  4154.  
  4155.  
  4156.                           09/23/93
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162. 11-3                      TERMCAP                       11-3
  4163.  
  4164.  
  4165.      If the capabilities above aren't given, then Elvis will
  4166. try to use the following values instead.
  4167.  
  4168.         :ve=:       normal cursor, used as :cQ=:cX=:cI=:cR=:
  4169.         :vs=:       gaudy cursor, used as :cV=:
  4170.  
  4171.  
  4172. An example
  4173.  
  4174.      Here's the termcap entry I use on my Minix-ST system.
  4175.  
  4176.  
  4177. mx|minix|minixst|ansi:\
  4178.         :is=\E[0~:co#80:li#25:bs:pt:\
  4179.         :cm=\E[%i%d;%dH:up=\E[A:do=^J:nd=\E[C:sr=\EM:\
  4180.         :cd=\E[J:ce=\E[K:cl=\E[H\E[J:\
  4181.         :al=\E[L:dl=\E[M:ic=\E[@:dc=\E[P:im=:ei=:\
  4182.         :so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:\
  4183.         :md=\E[1m:me=\E[m:as=\E[1;3m:ae=\E[m:\
  4184.         :ku=\E[A:kd=\E[B:kr=\E[C:kl=\E[D:\
  4185.         :k1=\E[1~:k2=\E[2~:k3=\E[3~:k4=\E[4~:k5=\E[5~:\
  4186.         :k6=\E[6~:k7=\E[17~:k8=\E[18~:k9=\E[19~:k0=\E[20~:
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.                           09/23/93
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231. 12.  ENVIRONMENT VARIABLES
  4232.  
  4233.      Elvis examines several environment  variables  when  it
  4234. starts  up.   The  values of these variables are used inter-
  4235. nally for a variety of purposes.  You don't need  to  define
  4236. all  of  these; on most systems, Elvis only requires TERM to
  4237. be defined.  On AmigaDOS, MS-DOS or TOS systems,  even  that
  4238. is optional.
  4239.  
  4240. TERM, TERMCAP
  4241.      TERM tells Elvis the name of the termcap entry to  use.
  4242.      TERMCAP may contain either the entire termcap entry, or
  4243.      the  full  pathname  of  the  termcap  file  to  search
  4244.      through.
  4245.  
  4246.      If your version of Elvis is using tinytcap  instead  of
  4247.      the  full  termcap  library,  then the value of TERMCAP
  4248.      can't be the name of a file; it can only be  undefined,
  4249.      or  contain  the  entire termcap entry.  In the termcap
  4250.      entry, tinytcap will convert \E to an <Esc>  character,
  4251.      but  other  backslash  escapes  (\b, \r, etc.) or carat
  4252.      escapes (^[, ^M, etc.)  will not be converted  to  con-
  4253.      trol  characters.  Instead, you should embed the actual
  4254.      control character into the string.
  4255.  
  4256. TMP, TEMP
  4257.      These only work for AmigaDOS,  MS-DOS  and  Atari  TOS.
  4258.      Either  of  these  variables  may  be  used  to set the
  4259.      "directory"  option,  which  controls  where  temporary
  4260.      files are stored.  If you define them both, then TMP is
  4261.      used, and TEMP is ignored.
  4262.  
  4263. LINES, COLUMNS
  4264.      The termcap entry for your terminal should specify  the
  4265.      size  of  your  screen.   If  you're  using a windowing
  4266.      interface, then there is an  ioctl()  call  which  will
  4267.      provide the size of the window; the ioctl() values will
  4268.      override the values in the termcap  entry.   The  LINES
  4269.      and  COLUMNS  environment  variables  (if defined) will
  4270.      override either of these sources.  They, in  turn,  can
  4271.      be overridden by a ":set" command.
  4272.  
  4273.      Normally, the LINES  and  COLUMNS  variables  shouldn't
  4274.      need to be defined.
  4275.  
  4276. EXINITThis variable's value may contain one or  more  colon-
  4277.      mode  commands, which will be executed after all of the
  4278.      ".exrc" files but before interactive editing begins.
  4279.  
  4280.      To put  more  than  one  command  in  EXINIT,  you  can
  4281.      separate  the  commands  with either a newline or a '|'
  4282.      character.
  4283.  
  4284. SHELL, COMSPEC
  4285.  
  4286.  
  4287.  
  4288.                           09/23/93
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294. 12-2               ENVIRONMENT VARIABLES                12-2
  4295.  
  4296.  
  4297.      You can use COMSPEC in MS-DOS, or SHELL  in  any  other
  4298.      system,  to specify which shell should be used for exe-
  4299.      cuting commands and expanding wildcards.
  4300.  
  4301. HOME This variable should give the  full  pathname  of  your
  4302.      home  directory.   Elvis needs to know the name of your
  4303.      home directory so it can locate the ".exrc" file there.
  4304.  
  4305. TAGPATH
  4306.      This variable is used by the "ref"  program.   It  con-
  4307.      tains  a  list  of  directories  that  might  contain a
  4308.      relevent "tags" file.  Under AmigaDOS, MS-DOS or  Atari
  4309.      TOS,  the  names of the directories should be separated
  4310.      by semicolons (";").  Under  other  operating  systems,
  4311.      the names should be separated by colons (":").
  4312.  
  4313.      If you don't define TAGPATH,  then  "ref"  will  use  a
  4314.      default list which includes the current directory and a
  4315.      few other likely places.  See the definition of DEFTAG-
  4316.      PATH at the start of ref.c for an accurate list.
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.                           09/23/93
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363. 13.  VERSIONS
  4364.  
  4365.      Elvis currently works under  BSD  UNIX,  AT&T  System-V
  4366. UNIX,   SCO  XENIX,  Minix,  Coherent,  MS-DOS,  Atari  TOS,
  4367. OS9/68k, VAX/VMS, and AmigaDos.  This section of the  manual
  4368. provides special information that applies to each particular
  4369. version of Elvis.
  4370.  
  4371.      For all  versions  except  MS-DOS  and  VMS,  the  file
  4372. "Makefile.mix"  should  be  copied  to  "Makefile", and then
  4373. edited to select the correct set of options for your system.
  4374. There  is  more  information about this embedded in the file
  4375. itself.
  4376.  
  4377. 13.1.  BSD UNIX
  4378.  
  4379.      Temporary files are stored in /tmp.
  4380.  
  4381.      You should modify /etc/rc so that the  temp  files  are
  4382. preserved  when  the  system  is  rebooted.   Find a line in
  4383. /etc/rc which reads
  4384.  
  4385.      ex4.3preserve /tmp
  4386.  
  4387. or something like that, and append the following line:
  4388.  
  4389.      elvprsv /tmp/elv*
  4390.  
  4391.      If you do not have permission to modify /etc/rc,  don't
  4392. fret.  The above modification is only needed to allow you to
  4393. recover your changes after a system crash.   You  can  still
  4394. run  Elvis  without  that  modification,  and  you can still
  4395. recover your changes when Elvis crashes or when your  dialup
  4396. modem  looses  the  carrier  signal, or something like that.
  4397. Only a system crash or power failure could hurt you.
  4398.  
  4399.      Both Elvis and the real Vi read initialization commands
  4400. from  a  file  called ".exrc", but the commands in that file
  4401. might work on one editor but not the  other.   For  example,
  4402. "set  keywordprg=man"  will work for Elvis, but Vi will com-
  4403. plain because it doesn't have a "keywordprg" option.  If the
  4404. warning  messages  annoy  you,  then you can edit the CFLAGS
  4405. setting in the Makefile and add -DEXRC=\".elvisrc\".
  4406.  
  4407.      If you use X windows, you may wish to add "-DCS_LATIN1"
  4408. to  CFLAGS.  This will cause the digraph table and the flip-
  4409. case option to have default values that are appropriate  for
  4410. the  LATIN-1  character  set.  That's the standard character
  4411. set for X.
  4412.  
  4413.      The default mailer  used  notify  users  when  text  is
  4414. preserver  is "mail".  You may wish to change this to "Mail"
  4415. (with an uppercase 'M').  See the description of "MAILER" in
  4416. the CFLAGS section of this manual.
  4417.  
  4418.  
  4419.  
  4420.                           09/23/93
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426. 13-2                      VERSIONS                      13-2
  4427.  
  4428.  
  4429.      The default keyboard macro time-out value is larger for
  4430. BSD  than  it  is  for  some other systems, because I've had
  4431. trouble running Elvis via rlogin or Xterm.  I guess it takes
  4432. a while for those keystokes to squirt through the net.
  4433.  
  4434. 13.2.  System-V UNIX
  4435.  
  4436.      Most SysV UNIX systems use terminfo instead of termcap,
  4437. but  the  terminfo  library  doesn't seem to have a standard
  4438. name.  As shipped, Elvis' Makefile.mix  is  configured  with
  4439. "LIBS=-ltermcap".   You  may  need  to  change it to "LIBS=-
  4440. lterm" or "LIBS=-lterminfo" or even "LIBS=-lcurses".
  4441.  
  4442.      The /etc/rc file (or its equivelent) should be modified
  4443. as  described for BSD systems, above.  There's a pretty good
  4444. chance that "make install" will do this for  you;  it  knows
  4445. how  to  create  an  editor  recovery file in the /etc/rc2.d
  4446. directory, which is where most  modern  SysV  systems  store
  4447. initialization  commands.   You  only need to do it manually
  4448. for older SysV systems.
  4449.  
  4450.      The potential trouble with ".exrc" described above  for
  4451. BSD UNIX applies to System-V UNIX as well.
  4452.  
  4453.      The default mailer  used  notify  users  when  text  is
  4454. preserver  is  "mail".   You  may  wish  to  change  this to
  4455. "mailx".  See the description of "MAILER" in the CFLAGS sec-
  4456. tion of this manual.
  4457.  
  4458.      Elvis uses control-C as the interrupt key, not  Delete.
  4459. This  was done so that the <Del> key could be used for char-
  4460. acter deletion.
  4461.  
  4462. 13.3.  SCO Xenix
  4463.  
  4464.      For Xenix-386, you can use the  generic  System-V  set-
  4465. tings.   You may wish to add "-DCS_IBMPC" to CFLAGS, to have
  4466. the digraph table and flipcase option start  up  in  a  mode
  4467. that  is appropriate for the console.  Also, note that there
  4468. is a separate group of settings for use with Xenix-286.   It
  4469. already has "-DCS_IBMPC" in CFLAGS.
  4470.  
  4471.      Because Xenix is so similar to System-V,  everything  I
  4472. said  earlier  about  System-V  applies to the Xenix version
  4473. too, except that editor recovery might belong in a directory
  4474. called /etc/rc.d/8 instead.
  4475.  
  4476. 13.4.  Minix
  4477.  
  4478.      There are separate settings in Makefile.mix for  Minix-
  4479. PC  and  Minix-68k.   The  differences between these two are
  4480. that the 68k version uses ".o" for the object file extension
  4481. where  the PC version uses ".s", and the PC version has some
  4482. extra flags in CFLAGS to reduce the size of Elvis.   The  PC
  4483.  
  4484.  
  4485.  
  4486.                           09/23/93
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492. 13-3                      VERSIONS                      13-3
  4493.  
  4494.  
  4495. version  also uses tinytcap (instead of the full termcap) to
  4496. make it smaller.
  4497.  
  4498.      Minix-PC users should read the CFLAGS section  of  this
  4499. manual very carefully.  You have some choices to make...
  4500.  
  4501.      The  temporary  files  are  stored  in  /usr/tmp.   The
  4502. /usr/tmp  directory  must exist before you run Elvis, and it
  4503. must be readable & writable by everybody.  We  use  /usr/tmp
  4504. instead  of  /tmp  because  after  a  system  crash or power
  4505. failure, you can recover the altered version of a file  from
  4506. the  temporary  file in /usr/tmp.  If it was stored in /tmp,
  4507. though, then it would  be  lost  because  /tmp  is  normally
  4508. located  on the RAM disk.  Also, you'll need a /usr/preserve
  4509. directory which is readable & writable by root; this  direc-
  4510. tory  is  used  to store text files that have been preserved
  4511. after a crash.  The "make install" script will create it  if
  4512. necessary.
  4513.  
  4514.      Elvis uses control-C as the interrupt key, not Delete.
  4515.  
  4516. 13.5.  Coherent
  4517.  
  4518.      Elvis was ported to Coherent by Esa Ahola.
  4519.  
  4520.      Elvis is too large to run  under  Coherent  unless  you
  4521. eliminate  some features via the CFLAGS setting.  The recom-
  4522. mended settings, in Makefile.mix, produce a working  version
  4523. of Elvis which emulates Vi faithfully, but lacks most of the
  4524. extensions.  You should read  the  CFLAGS  section  of  this
  4525. manual carefully.
  4526.  
  4527.      You can probably reduce the  size  of  Elvis  by  using
  4528. tinytcap.c  instead of -lterm.  This would allow you to keep
  4529. most features of Elvis, at the expense of terminal  indepen-
  4530. dence.   (Tinytcap.c  has  ANSI  escape sequences hard-coded
  4531. into it.)  To use tinytcap, just  add  "tinytcap.o"  to  the
  4532. "EXTRA="  line in the Makefile, and remove "-lterm" from the
  4533. "LIBS=" line.
  4534.  
  4535.      The temporary files  are  stored  in  /tmp.   Preserved
  4536. files  are  stored in /usr/preserve.  You should modify your
  4537. /etc/rc file to support  file  file  preservation;  add  the
  4538. line...
  4539.  
  4540.         /usr/bin/elvprsv /tmp/*
  4541.  
  4542.  
  4543. 13.6.  MS-DOS
  4544.  
  4545.      Elvis was ported to MS-DOS by Guntram Blohm and  Martin
  4546. Patzel.  Willett Kempton added support for the DEC Rainbow.
  4547.  
  4548.      Ideally, Elvis should be compiled with Microsoft C 5.10
  4549.  
  4550.  
  4551.  
  4552.                           09/23/93
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558. 13-4                      VERSIONS                      13-4
  4559.  
  4560.  
  4561. and  the  standard  Microsoft  Make utility, via the command
  4562. "make elvis.mak".  This will compile Elvis and  all  related
  4563. utilities.
  4564.  
  4565.      With Microsoft C 6.00, you may have  trouble  compiling
  4566. regexp.c.  If so, try compiling it without optimization.
  4567.  
  4568.      The "Makefile.mix" file contains  a  set  of  suggested
  4569. settings for compiling Elvis with Turbo-C or Borland C.  (If
  4570. you have Turbo-C, but not the Make  utility,  then  you  can
  4571. almost  use  the  "Elvis.prj" file to compile Elvis, but you
  4572. must  explicitly  force  Turbo-C  to  compile  it  with  the
  4573. "medium" memory model.  Most of the related programs [ctags,
  4574. ref, virec, refont, and wildcard] are only one file long, so
  4575. you  should  have no trouble compiling them.)  The "alias.c"
  4576. file is meant to be compiled once into an  executable  named
  4577. "ex.exe".   You  should  then  copy "ex.exe" to "vi.exe" and
  4578. "view.exe".
  4579.  
  4580.      Elvis stores its temporary files in C:\tmp.  If this is
  4581. not  satisfactory,  then  you should edit the CFLAGS line of
  4582. your Makefile to change TMPDIR to something else before com-
  4583. piling.  You can also control the name of the temp directory
  4584. via an environment variable named TMP or TEMP.   The  direc-
  4585. tory must exist before you can run Elvis.
  4586.  
  4587.      The TERM environment variable determines how Elvis will
  4588. write  to  the screen.  It can be set to any one of the fol-
  4589. lowing values:
  4590.  
  4591.                pcbios    Use BIOS calls on an IBM-PC clone.
  4592.                rainbow   Use DEC Rainbow interface.
  4593.                ansi      Use ANSI.SYS driver.
  4594.                nansi     User faster NANSI.SYS driver.
  4595.  
  4596.  
  4597.      If  the  TERM  variable  isn't  set,  then  Elvis  will
  4598. automatically  select  either  the "rainbow" interface (when
  4599. run on a Rainbow) or "pcbios" (on an IBM clone).
  4600.  
  4601.      You may prefer to use NANSI.SYS for speed; or  you  may
  4602. NEED to use ANSI.SYS for a non-clone, such as a lap-top.  If
  4603. so, you should  install  one  of  these  drivers  by  adding
  4604. "driver  = nansi.sys" (or whatever) to your CONFIG.SYS file,
  4605. and then you should define TERM to be "nansi" (or  whatever)
  4606. by  adding  "set TERM=nansi" to your AUTOEXEC.BAT file.  You
  4607. must then reboot for these changes to  take  effect.   After
  4608. that,  Elvis  will  notice  the  "TERM"  setting and use the
  4609. driver.
  4610.  
  4611.      Since ".exrc" is not a valid DOS filename, the name  of
  4612. the  initialization  file  has  been  changed to "elvis.rc".
  4613. Elvis will look for an "elvis.rc" file first  in  your  home
  4614. directory.   If  it  exists,  and contains ":set exrc", then
  4615.  
  4616.  
  4617.  
  4618.                           09/23/93
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624. 13-5                      VERSIONS                      13-5
  4625.  
  4626.  
  4627. Elvis will check  for  another  "elvis.rc"  in  the  current
  4628. directory.    By  default,  the  directory  where  ELVIS.EXE
  4629. resides is taken to be your home directory.  You  can  over-
  4630. ride  this  default by setting an environment variable named
  4631. "HOME" to the full pathname of your home directory.  To  set
  4632. "HOME",  you  would typically add the following line to your
  4633. AUTOEXEC.BAT file:
  4634.      set HOME c:\
  4635.  
  4636.      An extra program, called "wildcard", is needed for  MS-
  4637. DOS.   It  expands  wildcard  characters  in file names.  If
  4638. Elvis flashes a "Bad command or filename"  message  when  it
  4639. starts,  then  you've probably lost the WILDCARD.EXE program
  4640. somehow.
  4641.  
  4642.      Elvis can run under Windows, but you may  have  trouble
  4643. with TEMP.  Windows uses an environment variable called TEMP
  4644. which interferes with Elvis' usage of TEMP; to  work  around
  4645. this,  you  can simply set an environment variable named TMP
  4646. (with no 'E') to the name  of  Elvis'  temporary  directory.
  4647. When  TEMP  and TMP are both set, Elvis uses TMP and ignored
  4648. TEMP.
  4649.  
  4650. 13.7.  Atari TOS
  4651.  
  4652.      Elvis was ported to Atari TOS by Guntram Blohm and Mar-
  4653. tin  Patzel.   It is very similar to the MS-DOS version.  It
  4654. has been tested with the Mark Williams C compiler  and  also
  4655. GNU-C.
  4656.  
  4657.      The TERM environment variable is ignored; the  ST  port
  4658. always  assumes  that  TERM=vt52.   The SHELL (not COMSPEC!)
  4659. variable should be set to the name of a line-oriented shell.
  4660.  
  4661.      A simple shell in included with Elvis.  Its  source  is
  4662. in "shell.c", and the name of the executable is "shell.ttp".
  4663. The file "profile.sh" should contain a set  of  instructions
  4664. to  be  executed when the shell first starts up.  An example
  4665. of this file is included, but you will almost certainly want
  4666. to  edit it right away to match your configuration.  (If you
  4667. already have a command-line shell, then you'll probably want
  4668. to  continue  using  it.  The shell that comes with Elvis is
  4669. very limited.)
  4670.  
  4671.      Currently, character attributes cannot be displayed  on
  4672. the screen.
  4673.  
  4674.      Elvis runs under MiNT (a free  multi-tasking  extension
  4675. to  TOS)  but  it  can  be a CPU hog because of the way that
  4676. Elvis reads from the keyboard  with  timeout.   Also,  Elvis
  4677. doesn't  use  any  of  the special features of MiNT.  I have
  4678. received a set of patches that optimize Elvis for MiNT,  but
  4679. they arrived too late to integrate into this release.
  4680.  
  4681.  
  4682.  
  4683.  
  4684.                           09/23/93
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690. 13-6                      VERSIONS                      13-6
  4691.  
  4692.  
  4693. 13.8.  OS9/68k
  4694.  
  4695.      Elvis was ported to OS9/68k by Peter Reinig.
  4696.  
  4697.      The Makefile is currently configured to  install  Elvis
  4698. and  the  related  programs  in /dd/usr/cmds If this this is
  4699. unacceptable, then you should change the BIN setting to some
  4700. other  directory.   Similarly, it expects the source code to
  4701. reside in /dd/usr/src/elvis; the ODIR  setting  is  used  to
  4702. control this.
  4703.  
  4704.      Temporary files are stored in  the  /dd/tmp  directory.
  4705. Your  /dd/startup file may need to be modified to prevent it
  4706. from deleting Elvis' temporary files; make  /dd/startup  run
  4707. the elvprsv program before it wipes out /dd/tmp.
  4708.  
  4709.      The program in alias.c is linked repeatedly to  produce
  4710. the "vi", "view", and "input" aliases for Elvis.  Sadly, the
  4711. "ex" alias is impossible to implement under OS9 because  the
  4712. shell has a built-in command by that name.
  4713.  
  4714.      For some  purposes,  you  must  give  `make'  the  "-b"
  4715. option.  Specifically, you need this for "make -b clean" and
  4716. "make -b install".
  4717.  
  4718. 13.9.  VAX/VMS
  4719.  
  4720.      John Campbell ported Elvis to VAX/VMS.
  4721.  
  4722.      A heavily laden VAX can take half an  hour  to  compile
  4723. Elvis.  This is normal.  Don't panic.
  4724.  
  4725.      While running, Elvis will  create  temporary  files  in
  4726. SYS$SCRATCH.   Enter  SHOW  LOGICAL  SYS$SCRATCH to see what
  4727. actual directory you are using.  Many sites have SYS$SCRATCH
  4728. equivalenced  to  SYS$LOGIN.  The Elvis temporary files look
  4729. like the following on VMS while Elvis is running:
  4730.        ELV_1123A.1;1       ELV_1123A.2;1       SO070202.;1
  4731.  
  4732.      Also, filtering commands (like !!dir and !}fmt)  should
  4733. work  on  VMS.   This  assumes, however, that you can create
  4734. temporary mailboxes and that your mailbox  quota  (a  sysgen
  4735. parameter)  is  at least 256 bytes for a single write to the
  4736. mailbox.  This is the default  sysgen  parameter,  so  there
  4737. should be few people who experience filter problems.
  4738.  
  4739.      Additionally, an attempt was made to support the  stan-
  4740. dard  terminals  on VMS:  "vt52", "vt100", "vt200", "vt300",
  4741. "vt101", "vt102".  Non-standard terminals could be supported
  4742. by  setting  your  terminal type to UNKNOWN (by entering SET
  4743. TERM/UNKNOWN) and  defining  the  logical  name  ELVIS_TERM.
  4744. Whatever  ELVIS_TERM translates to, however, will have to be
  4745. included in tinytcap.c.  Note that the upper/lowercase  dis-
  4746. tinctions   are  significant,  and  that  DCL  will  upshift
  4747.  
  4748.  
  4749.  
  4750.                           09/23/93
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756. 13-7                      VERSIONS                      13-7
  4757.  
  4758.  
  4759. characters that are not  quoted  strings,  so  enter  DEFINE
  4760. ELVIS_TERM "hp2621a".  As distributed, it would probably not
  4761. be a good idea to have more than the standard  terminals  in
  4762. tinytcap.c  (else  it wouldn't be tiny, would it?).  Changes
  4763. here, of course,  would  require  a  recompilation  to  take
  4764. effect.
  4765.  
  4766.      If you have a version  of  the  "termcap"  library  and
  4767. database  on  your  system,  then  you  may  wish to replace
  4768. tinytcap with the real termcap.
  4769.  
  4770. 13.10.  AmigaDOS
  4771.  
  4772.      Mike Rieser and Dale Rahn ported Elvis to AmigaDOS.
  4773.  
  4774.      The port was done using  Manx  Aztec  C  version  5.2b.
  4775. Elvis  uses about as much space as it can and still be small
  4776. code and data.  Elvis should also compile under DICE, though
  4777. there  may  be  a little trouble with signed versus unsigned
  4778. chars.
  4779.  
  4780.      The port has been done so  the  same  binary  will  run
  4781. under both versions of AmigaDOS.  Under AmigaDOS 2.04, Elvis
  4782. supports all the  documented  features.   It  also  uses  an
  4783. external program ref to do tag lookup.  So, the accompanying
  4784. programs: ref and ctags  are  recommended.   Under  AmigaDOS
  4785. 1.2/1.3 Elvis works, buts lacks the more advanced features.
  4786.  
  4787.      For the port to AmigaDOS 2.04, we tried to use as  many
  4788. Native  AmigaDOS  calls  as  we could.  This should increase
  4789. Elvis's chances at  being  compiled  with  other  compilers.
  4790. DICE  seems  to have a different default char type.  You may
  4791. need to use the UCHAR() macro in tio.c.  To test it, try the
  4792. :map command; if it looks right, things are cool.
  4793.  
  4794.      For the port to AmigaDOS 1.3, we tried to make sure the
  4795. program  was  at  least  usable.  Many features are missing,
  4796. most notably running commands in subshells.  Also,  what  we
  4797. could  get working, we used Aztec functions to support them,
  4798. so this part is little more compiler dependent.
  4799.  
  4800.      Aztec is compatible with the SAS  libcall  #pragma.   I
  4801. personally  prefer  using the includes that come from Commo-
  4802. dore over the ones supplied with Aztec, but for people  with
  4803. a straight Aztec installation, I went with the default names
  4804. for the Aztec pragmas.
  4805.  
  4806.      One include you'll need is <sys/types.h>.  It's a  com-
  4807. mon  include  when  porting software just make yourself one.
  4808. It's a two line file that saves a lot of  hassle  especially
  4809. in  the  Elvis  source.   So,  make  a  directory where your
  4810. includes are located called `sys' and in a file  below  that
  4811. type:
  4812.         /* sys/types.h */
  4813.  
  4814.  
  4815.  
  4816.                           09/23/93
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822. 13-8                      VERSIONS                      13-8
  4823.  
  4824.  
  4825.         #include <exec/types.h>
  4826.  
  4827.      When setting environment  variables  (either  local  or
  4828. global)  for  variables  that specify a directory, make sure
  4829. the variable ends in `:'  or `/'.  This saved from having to
  4830. change  much  of the way Elvis works.  The default temporary
  4831. directory (if TEMP and TMP aren't specified) is  "T:".   The
  4832. default  if  HOME directory (if no HOME environment variable
  4833. is set) is "S:".
  4834.  
  4835.      To avoid conlict with other uses, Elvis  uses  elvis.rc
  4836. instead of .exrc or where it looks for macros.
  4837.  
  4838. 13.11.  Other Systems
  4839.  
  4840.      For SunOS and Solaris 1.x, use the  BSD  settings;  for
  4841. Solaris  2.x,  use  the  SysV settings.  Earlier versions of
  4842. Elvis didn't link correctly due to a quirk in Sun's  version
  4843. of  the  "make"  utility,  but  this  version of Elvis has a
  4844. work-around for that quirk so you should have no trouble  at
  4845. all.
  4846.  
  4847.      For Linux, use the SysV  settings.   You  can  probably
  4848. just remove the "-lterm" from the "LIBS= -lterm" line, since
  4849. linux keeps the termcap functions in the standard C library.
  4850.  
  4851.      For other UNIXoid systems, I suggest you start with the
  4852. Minix-68k settings and then grow from that.  Minix is a nice
  4853. starting point because it is a  clone  of  Version  7  UNIX,
  4854. which  was  the  last  common  ancestor of BSD UNIX and SysV
  4855. UNIX.  Any Operating System which claims any  UNIX  compati-
  4856. bility  what  so  ever will therefore support V7/Minix code.
  4857. You may need to fiddle with  #include  directives  or  some-
  4858. thing,  though.   Minix-68k  is a better starting point than
  4859. Minix-PC because the PC compiler has some severe quirks.
  4860.  
  4861.      If you're thinking of porting Elvis  to  some  non-UNIX
  4862. system, I suggest you begin by studying the "INTERNALS" sec-
  4863. tion of this manual.
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.  
  4882.                           09/23/93
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891. 14.  QUESTIONS & ANSWERS
  4892.  
  4893.  
  4894. 1)  How can I make Elvis run faster under DOS?
  4895.  
  4896.        There are several things you can do.  The first thing
  4897.        to  do is get a good screen driver such as NANSI.SYS.
  4898.        This can speed up screen redrawing by as  much  as  a
  4899.        factor of eight!  The DOS-specific part of section 12
  4900.        tells you how to do this.
  4901.  
  4902.        You might also consider  reducing  the  size  of  the
  4903.        blocks  that  Elvis  uses.   You'll need to recompile
  4904.        Elvis to do this.  The default BLKSIZE is  1024  byte
  4905.        for  the  DOS  version of Elvis, which means that for
  4906.        each keystroke that you insert, Elvis must  shift  an
  4907.        average of about 500 bytes.  That's a lot to ask from
  4908.        a little old 5MHz 8088.  A BLKSIZE of 512 bytes might
  4909.        be more appropriate.
  4910.  
  4911.        If you're really desperate for more speed, you  might
  4912.        want to make Elvis store its temporary files on a RAM
  4913.        disk.  However, this limits the size of the file  you
  4914.        can  edit,  and it eliminates any chance you may have
  4915.        had to recover your work after  a  power  failure  or
  4916.        system  crash,  but it might be worth it; you decide.
  4917.        To do this, add ":set dir=R:\" (or whatever your  RAM
  4918.        disk's name is) to the elvis.rc file.
  4919.  
  4920.        Next, consider turning off the "sync"  option.   When
  4921.        the  sync  option  is turned on, Elvis will close the
  4922.        temporary file and reopen it after every  change,  in
  4923.        order  to  force  DOS  to update the file's directory
  4924.        entry.  If you put ":set nosync"  into  the  elvis.rc
  4925.        file,  then  Elvis  will only close the file when you
  4926.        start editing a different text file, or  when  you're
  4927.        exiting Elvis.  Consequently, there is no chance that
  4928.        you'll be able to recover your changes after a  power
  4929.        failure... so if you're going to this, then you might
  4930.        as well store the temp files on the RAM disk, too.
  4931.  
  4932.  
  4933. 2)  Where's the <Esc> key on a DEC keyboard?
  4934.  
  4935.        I don't know.  Maybe the <F11> key?  You could always
  4936.        use ":map!" to make some other key act like the <Esc>
  4937.        key.  If all else fails, use <Control><[>.
  4938.  
  4939.  
  4940. 3)  Is there a way to show which keys do what?
  4941.  
  4942.        Yes.  The command ":map" will show what each key does
  4943.        in  command  mode,  and  ":map!" (with an exclamation
  4944.        mark) shows what each key does in input mode.
  4945.  
  4946.  
  4947.  
  4948.                           09/23/93
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954. 14-2                QUESTIONS & ANSWERS                 14-2
  4955.  
  4956.  
  4957.        The table is divided into three  columns:  the  key's
  4958.        label,  the characters that it sends, and the charac-
  4959.        ters that Elvis pretends you typed.
  4960.  
  4961.  
  4962. 4)  How can I make Elvis display long lines  like  the  real
  4963.     vi?
  4964.  
  4965.        You can't yet.  The next version of Elvis should sup-
  4966.        port this, though.
  4967.  
  4968.  
  4969. 5)  I can't recover my text [under  MS-DOS  or  Atari  TOS].
  4970.     According  to  the directory listing, the temporary file
  4971.     is 0 bytes long.  What went wrong?
  4972.  
  4973.        MS-DOS and TOS only update a file's  directory  entry
  4974.        when the file is closed.  If the system crashes while
  4975.        the file is still open, then  the  file's  length  is
  4976.        stored  as  0  bytes.  The ":set sync" option is sup-
  4977.        posed to prevent this; you probably turned it off  in
  4978.        the interest of speed, right?
  4979.  
  4980.        Under MS-DOS [I don't know  about  TOS],  you  should
  4981.        delete   the  empty  temporary  file,  and  then  run
  4982.        CHKDSK/F.  This might find the data that belonged  in
  4983.        the  empty  file,  and  place it in a new file with a
  4984.        name like "000001.CHK" -- something like  that.   You
  4985.        can  then try to extract the text from that temporary
  4986.        file by giving the command "elvprsv  -R  000001.chk".
  4987.        If you're lucky, then this might recover your text.
  4988.  
  4989.  
  4990. 6)  What is the most current version of Elvis?
  4991.  
  4992.        Each version of Elvis that is released to the  public
  4993.        has  a  version  number  of  the  form  "number point
  4994.        number".  As I write this, the most  current  version
  4995.        of Elvis is 1.7.
  4996.  
  4997.        The intermediate steps between one  release  and  the
  4998.        next are labeled with the next version number, with a
  4999.        letter  appended.   For  example,   after   1.4   was
  5000.        released,  I started working on 1.5a.  I am currently
  5001.        working on 2.0a.  When Elvis reaches a stable  state,
  5002.        I'll call it 2.0 and release it.
  5003.  
  5004.        Sometimes a beta-test version of Elvis will be avail-
  5005.        able  via  anonymous FTP from m2xenix.psg.com, in the
  5006.        directory "pub/elvis/beta".
  5007.  
  5008.  
  5009. 7)  I only got executables, but now I want the source  code.
  5010.     Where can I get it?
  5011.  
  5012.  
  5013.  
  5014.                           09/23/93
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020. 14-3                QUESTIONS & ANSWERS                 14-3
  5021.  
  5022.  
  5023.        If you have access to the Internet, then  you  should
  5024.        be  able  to fetch it from one of the public archives
  5025.        such  as  plains.nodak.edu.   It  is  accessible  via
  5026.        anonymous   FTP,   or   via  an  email  server  named
  5027.        "archive-server@plains.nodak.edu".  Elvis is  located
  5028.        in the directory "/pub/Minix/all.contrib".
  5029.  
  5030.        It is also available from  the  C  Users'  Group,  in
  5031.        volume #365.  As I write this, they are asking $4 per
  5032.        disk plus $3.50  per  order  in  the  US,  and  elvis
  5033.        requires  three  disks;  this  is  subject to change.
  5034.        Their phone  number  is  (913)  841-1631,  and  their
  5035.        address is:
  5036.  
  5037.  
  5038.                                 The C Users' Group
  5039.                                 1601 W. 23rd Street, #200
  5040.                                 Lawrence  KS  66046-2743
  5041.  
  5042.  
  5043.  
  5044. 8)  Is this shareware, or public domain, or what?
  5045.  
  5046.        It is not public domain; it  is  copyrighted  by  me,
  5047.        Steve  Kirkendall.   However, this particular version
  5048.        is freely redistributable, in either source  form  or
  5049.        executable  form.   (I  would  prefer  that  you give
  5050.        copies away for free, complete with the  full  source
  5051.        code... but I'm not going to force you.)
  5052.  
  5053.        It is not shareware; you aren't expected to  send  me
  5054.        anything.  You can use it without guilt.
  5055.  
  5056.        It is not "copylefted."   I  hold  a  copyright,  but
  5057.        currently  I have not added any of the usual restric-
  5058.        tions that you would find on copylefted software.  If
  5059.        people  start doing really obnoxious things to Elvis,
  5060.        then I will start adding restrictions  to  subsequent
  5061.        versions,  but  earlier  versions  won't be affected.
  5062.        (So far, everybody has been pretty good about this so
  5063.        no restrictions have been necessary.)
  5064.  
  5065.  
  5066. 9)  Can I reuse parts of your source code?
  5067.  
  5068.        Yes.  Please be careful, though, to  make  sure  that
  5069.        the  code  really is mine.  Some of the code was con-
  5070.        tributed by  other  people,  and  I  don't  have  the
  5071.        authority  to  give  you  permission  to use it.  The
  5072.        author's name can be  found  near  the  top  of  each
  5073.        source  file.  If it says "Steve Kirkendall" then you
  5074.        may use  it;  otherwise,  you'd  better  contact  the
  5075.        author first.
  5076.  
  5077.  
  5078.  
  5079.  
  5080.                           09/23/93
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086. 14-4                QUESTIONS & ANSWERS                 14-4
  5087.  
  5088.  
  5089.        Please don't remove my name from the source code.  If
  5090.        you  modify  the  source,  please make a note of that
  5091.        fact in a comment near the top of  the  source  code.
  5092.        And, finally, please mention my name in your documen-
  5093.        tation.
  5094.  
  5095.  
  5096. 10) Can Elvis work with non-ASCII files?
  5097.  
  5098.        Elvis is 8-bit clean.  This  means  that  Elvis  will
  5099.        allow  you to edit files that use a European extended
  5100.        ASCII character set.  However, some terminals are not
  5101.        8-bit  clean;  they  treat  characters  in  the range
  5102.        0x80-0x9f as control characters.  Elvis  expects  all
  5103.        characters   above  0x7f  to  be  treated  as  normal
  5104.        displayable characters, so on these  terminals  Elvis
  5105.        may produce a scrambled display.
  5106.  
  5107.        Elvis can't edit binary files because it can't handle
  5108.        the NUL character, and because of line-length limita-
  5109.        tions.
  5110.  
  5111.        Elvis has also modified to work with 16-bit character
  5112.        sets,  but that modification is not part of the stan-
  5113.        dard    Elvis    distribution.     Yongguang    Zhang
  5114.        (ygz@cs.purdue.edu)  has created a Chinese version of
  5115.        Elvis that uses  16-bit  characters  and  runs  under
  5116.        cxterm  (Chinese X-term) on X-windows systems.  Juni-
  5117.        chiro Itoh (itojun@foretune.co.jp) has modified Elvis
  5118.        to edit Japanese text under MS-DOS.
  5119.  
  5120.  
  5121.  
  5122.  
  5123.  
  5124.  
  5125.  
  5126.  
  5127.  
  5128.  
  5129.  
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.                           09/23/93
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.      CTAGS(1)                                                 CTAGS(1)
  5153.  
  5154.  
  5155.  
  5156.      NAME
  5157.           ctags - Generates "tags" and (optionally) "refs" files
  5158.  
  5159.      SYNOPSIS
  5160.           ctags [-stvra] filesnames...
  5161.  
  5162.      DESCRIPTION
  5163.           ctags generates the "tags" and "refs" files from a group of
  5164.           C source files.  The "tags" file is used by Elvis' ":tag"
  5165.           command, control-] command, and -t option.  The "refs" file
  5166.           is sometimes used by the ref(1) program.
  5167.  
  5168.           Each C source file is scanned for #define statements and
  5169.           global function definitions.  The name of the macro or
  5170.           function becomes the name of a tag.  For each tag, a line is
  5171.           added to the "tags" file which contains:
  5172.                       - the name of the tag
  5173.                       - a tab character
  5174.                       - the name of the file containing the tag
  5175.                       - a tab character
  5176.                       - a way to find the particular line within the file.
  5177.  
  5178.           The filenames list will typically be the names of all C
  5179.           source files in the current directory, like this:
  5180.                $ ctags -stv *.[ch]
  5181.  
  5182.      OPTIONS
  5183.           -t   Include typedefs.  A tag will be generated for each
  5184.                user-defined type.  Also tags will be generated for
  5185.                struct and enum names.  Types are considered to be
  5186.                global if they are defined in a header file, and static
  5187.                if they are defined in a C source file.
  5188.  
  5189.           -v   Include variable declarations.  A tag will be generated
  5190.                for each variable, except for those that are declared
  5191.                inside the body of a function.
  5192.  
  5193.           -s   Include static tags.  Ctags will normally put global
  5194.                tags in the "tags" file, and silently ignore the static
  5195.                tags.  This flag causes both global and static tags to
  5196.                be added.  The name of a static tag is generated by
  5197.                prefixing the name of the declared item with the name
  5198.                of the file where it is defined, with a colon in
  5199.                between.  For example, "static foo(){}" in "bar.c"
  5200.                results in a tag named "bar.c:foo".
  5201.  
  5202.           -r   This causes ctags to generate both "tags" and "refs".
  5203.                Without -r, it would only generate "tags".
  5204.  
  5205.           -a   Append to "tags", and maybe "refs".  Normally, ctags
  5206.                overwrites these files each time it is invoked.  This
  5207.                flag is useful when you have to many files in the
  5208.  
  5209.  
  5210.  
  5211.      Page 1                                          (printed 9/23/93)
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.      CTAGS(1)                                                 CTAGS(1)
  5219.  
  5220.  
  5221.  
  5222.                current directory for you to list them on a single
  5223.                command-line; it allows you to split the arguments
  5224.                among several invocations.
  5225.  
  5226.      FILES
  5227.           tags A cross-reference that lists each tag name, the name of
  5228.                the source file that contains it, and a way to locate a
  5229.                particular line in the source file.
  5230.  
  5231.           refs The "refs" file contains the definitions for each tag
  5232.                in the "tags" file, and very little else.  This file
  5233.                can be useful, for example, when licensing restrictions
  5234.                prevent you from making the source code to the standard
  5235.                C library readable by everybody, but you still
  5236.                everybody to know what arguments the library functions
  5237.                need.
  5238.  
  5239.      BUGS
  5240.           ctags is sensitive to indenting and line breaks.
  5241.           Consequently, it might not discover all of the tags in a
  5242.           file that is formatted in an unusual way.
  5243.  
  5244.      SEE ALSO
  5245.           elvis(1), refs(1)
  5246.  
  5247.      AUTHOR
  5248.           Steve Kirkendall
  5249.           kirkenda@cs.pdx.edu
  5250.  
  5251.  
  5252.  
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.      Page 2                                          (printed 9/23/93)
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.      ELVIS(1)                                                 ELVIS(1)
  5285.  
  5286.  
  5287.  
  5288.      NAME
  5289.           elvis, ex, vi, view, input - The editor
  5290.  
  5291.      SYNOPSIS
  5292.           elvis [flags] [+cmd] [files...]
  5293.  
  5294.      DESCRIPTION
  5295.           Elvis is a text editor which emulates vi/ex.
  5296.  
  5297.           On systems which pass the program name as an argument, such
  5298.           as Unix and Minix, you may also install elvis under the
  5299.           names "ex", "vi", "view", and "input".  These extra names
  5300.           would normally be links to elvis; see the "ln" shell
  5301.           command.
  5302.  
  5303.           When elvis is invoked as "vi", it behaves exactly as though
  5304.           it was invoked as "elvis".  However, if you invoke elvis as
  5305.           "view", then the readonly option is set as though you had
  5306.           given it the "-R" flag.  If you invoke elvis as "ex", then
  5307.           elvis will start up in the colon command mode instead of the
  5308.           visual command mode, as though you had given it the "-e"
  5309.           flag.  If you invoke elvis as "input" or "edit", then elvis
  5310.           will start up in input mode, as though the "-i" flag was
  5311.           given.
  5312.  
  5313.      OPTIONS
  5314.           -r   To the real vi, this flag means that a previous edit
  5315.                should be recovered.  Elvis, though, has a separate
  5316.                program, called elvrec(1), for recovering files.  When
  5317.                you invoke elvis with -r, elvis will tell you to run
  5318.                elvrec.
  5319.  
  5320.           -R   This sets the "readonly" option, so you won't
  5321.                accidentally overwrite a file.
  5322.  
  5323.           -t tag
  5324.                This causes elvis to start editing at the given tag.
  5325.  
  5326.           -m [file]
  5327.                Elvis will search through file for something that looks
  5328.                like an error message from a compiler.  It will then
  5329.                begin editing the source file that caused the error,
  5330.                with the cursor sitting on the line where the error was
  5331.                detected.  If you don't explicitly name a file, then
  5332.                "errlist" is assumed.
  5333.  
  5334.           -e   Elvis will start up in colon command mode.
  5335.  
  5336.           -v   Elvis will start up in visual command mode.
  5337.  
  5338.           -i   Elvis will start up in input mode.
  5339.  
  5340.  
  5341.  
  5342.  
  5343.      Page 1                                          (printed 9/23/93)
  5344.  
  5345.  
  5346.  
  5347.  
  5348.  
  5349.  
  5350.      ELVIS(1)                                                 ELVIS(1)
  5351.  
  5352.  
  5353.  
  5354.           -w winsize
  5355.                Sets the "window" option's value to winsize.
  5356.  
  5357.           +command or -c command
  5358.                If you use the +command parameter, then after the first
  5359.                file is loaded command is executed as an EX command.  A
  5360.                typical example would be "elvis +237 foo", which would
  5361.                cause elvis to start editing foo and then move directly
  5362.                to line 237.  The "-c command" variant was added for
  5363.                UNIX SysV compatibility.
  5364.  
  5365.      FILES
  5366.           /tmp/elv*
  5367.                During editing, elvis stores text in a temporary file.
  5368.                For UNIX, this file will usually be stored in the /tmp
  5369.                directory, and the first three characters will be
  5370.                "elv".  For other systems, the temporary files may be
  5371.                stored someplace else; see the version-specific section
  5372.                of the documentation.
  5373.  
  5374.           tags This is the database used by the :tags command and the
  5375.                -t option.  It is usually created by the ctags(1)
  5376.                program.
  5377.  
  5378.           .exrc or elvis.rc
  5379.                On UNIX-like systems, a file called ".exrc" in your
  5380.                home directory is executed as a series of ex commands.
  5381.                A file by the same name may be executed in the current
  5382.                directory, too.  On non-UNIX systems, ".exrc" is
  5383.                usually an invalid file name; there, the initialization
  5384.                file is called "elvis.rc" instead.
  5385.  
  5386.      ENVIRONMENT
  5387.           TERM This is the name of your terminal's entry in the
  5388.                termcap or terminfo database.  The list of legal values
  5389.                varies from one system to another.
  5390.  
  5391.           TERMCAP
  5392.                Optional.  If your system uses termcap, and the TERMCAP
  5393.                variable is unset, then
  5394.                 will read your terminal's definition from
  5395.                /etc/termcap.  If TERMCAP is set to the full pathname
  5396.                of a file (starting with a '/') then  will look in the
  5397.                named file instead of /etc/termcap.  If TERMCAP is set
  5398.                to a value which doesn't start with a '/', then its
  5399.                value is assumed to be the full termcap entry for your
  5400.                terminal.
  5401.  
  5402.           TERMINFO
  5403.                Optional.  If your system uses terminfo, and the
  5404.                TERMINFO variable is unset, then
  5405.                 will read your terminal's definition from the database
  5406.  
  5407.  
  5408.  
  5409.      Page 2                                          (printed 9/23/93)
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416.      ELVIS(1)                                                 ELVIS(1)
  5417.  
  5418.  
  5419.  
  5420.                in the /usr/lib/terminfo database.  If TERMINFO is set,
  5421.                then its value is used as the database name to use
  5422.                instead of /usr/lib/terminfo.
  5423.  
  5424.           LINES, COLUMNS
  5425.                Optional.  These variables, if set, will override the
  5426.                screen size values given in the termcap/terminfo for
  5427.                your terminal.  On windowing systems such as X,  has
  5428.                other ways of determining the screen size, so you
  5429.                should probably leave these variables unset.
  5430.  
  5431.           EXINIT
  5432.                Optional.  This variable can hold EX commands which
  5433.                will be executed before any .exrc files.
  5434.  
  5435.           SHELL
  5436.                Optional.  The SHELL variable sets the default value
  5437.                for the "shell" option, which determines which shell
  5438.                program is used to perform wildcard expansion in file
  5439.                names, and also which is used to execute filters or
  5440.                external programs.  The default value on UNIX systems
  5441.                is "/bin/sh".
  5442.  
  5443.                Note: Under MS-DOS, this variable is called COMSPEC
  5444.                instead of SHELL.
  5445.  
  5446.           HOME This variable should be set to the name of your home
  5447.                directory.
  5448.                 looks for its initialization file there; if HOME is
  5449.                unset then the initialization file will not be
  5450.                executed.
  5451.  
  5452.           TAGPATH
  5453.                Optional.  This variable is used by the "ref" program,
  5454.                which is invoked by the shift-K, control-], and :tag
  5455.                commands.  See "ref" for more information.
  5456.  
  5457.           TMP, TEMP
  5458.                These optional environment variables are only used in
  5459.                non-UNIX versions of .  They allow you to supply a
  5460.                directory name to be used for storing temporary files.
  5461.  
  5462.      SEE ALSO
  5463.           ctags(1), ref(1), virec(1)
  5464.  
  5465.           Elvis - A Clone of Vi/Ex, the complete elvis documentation.
  5466.  
  5467.      BUGS
  5468.           There is no LISP support.  Certain other features are
  5469.           missing, too.
  5470.  
  5471.           Auto-indent mode is not quite compatible with the real vi.
  5472.  
  5473.  
  5474.  
  5475.      Page 3                                          (printed 9/23/93)
  5476.  
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.      ELVIS(1)                                                 ELVIS(1)
  5483.  
  5484.  
  5485.  
  5486.           Among other things, 0^D and ^^D don't do what you might
  5487.           expect.
  5488.  
  5489.           Long lines are displayed differently.  The real vi wraps
  5490.           long lines onto multiple rows of the screen, but elvis
  5491.           scrolls sideways.
  5492.  
  5493.      AUTHOR
  5494.           Steve Kirkendall
  5495.           kirkenda@cs.pdx.edu
  5496.  
  5497.           Many other people have worked to port elvis to various
  5498.           operating systems.  To see who deserves credit, run the
  5499.           :version command from within elvis, or look in the system-
  5500.           specific section of the complete documentation.
  5501.  
  5502.  
  5503.  
  5504.  
  5505.  
  5506.  
  5507.  
  5508.  
  5509.  
  5510.  
  5511.  
  5512.  
  5513.  
  5514.  
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.  
  5540.  
  5541.      Page 4                                          (printed 9/23/93)
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.      ELVPRSV(1)                                             ELVPRSV(1)
  5549.  
  5550.  
  5551.  
  5552.      NAME
  5553.           elvprsv - Preserve the the modified version of a file after
  5554.           a crash.
  5555.  
  5556.      SYNOPSIS
  5557.           elvprsv ["-why elvis died"] /tmp/filename...
  5558.           elvprsv -R /tmp/filename...
  5559.  
  5560.      DESCRIPTION
  5561.           elvprsv preserves your edited text after elvis dies.  The
  5562.           text can be recovered later, via the elvprsv program.
  5563.  
  5564.           For UNIX-like systems, you should never need to run this
  5565.           program from the command line.  It is run automatically when
  5566.           elvis is about to die, and it should be run (via /etc/rc)
  5567.           when the computer is booted.  THAT'S ALL!
  5568.  
  5569.           For non-UNIX systems such as MS-DOS, you can either use
  5570.           elvprsv the same way as under UNIX systems (by running it
  5571.           from your AUTOEXEC.BAT file), or you can run it separately
  5572.           with the "-R" flag to recover the files in one step.
  5573.  
  5574.           If you're editing a file when elvis dies (due to a bug,
  5575.           system crash, power failure, etc.)  then elvprsv will
  5576.           preserve the most recent version of your text.  The
  5577.           preserved text is stored in a special directory; it does NOT
  5578.           overwrite your text file automatically.
  5579.  
  5580.           elvprsv will send mail to any user whose work it preserves,
  5581.           if your operating system normally supports mail.
  5582.  
  5583.      FILES
  5584.           /tmp/elv*
  5585.                The temporary file that elvis was using when it died.
  5586.  
  5587.           /usr/preserve/p*
  5588.                The text that is preserved by elvprsv.
  5589.  
  5590.           /usr/preserve/Index
  5591.                A text file which lists the names of all preserved
  5592.                files, and the names of the /usr/preserve/p* files
  5593.                which contain their preserved text.
  5594.  
  5595.      BUGS
  5596.           Due to the permissions on the /usr/preserve directory, on
  5597.           UNIX systems elvprsv must be run as superuser.  This is
  5598.           accomplished by making the elvprsv executable be owned by
  5599.           "root" and turning on its "set user id" bit.
  5600.  
  5601.           If you're editing a nameless buffer when elvis dies, then
  5602.           elvprsv will pretend that the file was named "foo".
  5603.  
  5604.  
  5605.  
  5606.  
  5607.      Page 1                                          (printed 9/23/93)
  5608.  
  5609.  
  5610.  
  5611.  
  5612.  
  5613.  
  5614.      ELVPRSV(1)                                             ELVPRSV(1)
  5615.  
  5616.  
  5617.  
  5618.      AUTHOR
  5619.           Steve Kirkendall
  5620.           kirkenda@cs.pdx.edu
  5621.  
  5622.  
  5623.  
  5624.  
  5625.  
  5626.  
  5627.  
  5628.  
  5629.  
  5630.  
  5631.  
  5632.  
  5633.  
  5634.  
  5635.  
  5636.  
  5637.  
  5638.  
  5639.  
  5640.  
  5641.  
  5642.  
  5643.  
  5644.  
  5645.  
  5646.  
  5647.  
  5648.  
  5649.  
  5650.  
  5651.  
  5652.  
  5653.  
  5654.  
  5655.  
  5656.  
  5657.  
  5658.  
  5659.  
  5660.  
  5661.  
  5662.  
  5663.  
  5664.  
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.      Page 2                                          (printed 9/23/93)
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.      ELVREC(1)                                               ELVREC(1)
  5681.  
  5682.  
  5683.  
  5684.      NAME
  5685.           elvrec - Recover the modified version of a file after a
  5686.           crash
  5687.  
  5688.      SYNOPSIS
  5689.           elvrec [preservedfile [newfile]]
  5690.  
  5691.      DESCRIPTION
  5692.           If you're editing a file when elvis dies, the system
  5693.           crashes, or power fails, the most recent version of your
  5694.           text will be preserved.  The preserved text is stored in a
  5695.           special directory; it does NOT overwrite your text file
  5696.           automatically.
  5697.  
  5698.           The elvrec program locates the preserved version of a given
  5699.           file, and writes it over the top of your text file -- or to
  5700.           a new file, if you prefer.  The recovered file will have
  5701.           nearly all of your changes.
  5702.  
  5703.           To see a list of all recoverable files, run elvrec with no
  5704.           arguments.
  5705.  
  5706.      FILES
  5707.           /usr/preserve/p*
  5708.                The text that was preserved when elvis died.
  5709.  
  5710.           /usr/preserve/Index
  5711.                A text file which lists the names of all preserved
  5712.                files, and the names of the /usr/preserve/p* files
  5713.                which contain their preserved text.
  5714.  
  5715.      BUGS
  5716.           elvrec is very picky about filenames.  You must tell it to
  5717.           recover the file using exactly the same pathname as when you
  5718.           were editing it.  The simplest way to do this is to go into
  5719.           the same directory that you were editing, and invoke elvrec
  5720.           with the same filename as elvis.  If that doesn't work, then
  5721.           try running elvrec with no arguments, to see exactly which
  5722.           pathname it is using for the desired file.
  5723.  
  5724.           Due to the permissions on the /usr/preserve directory, on
  5725.           UNIX systems elvrec must be run as superuser.  This is
  5726.           accomplished by making the elvrec executable be owned by
  5727.           "root" and setting its "set user id" bit.
  5728.  
  5729.           If you're editing a nameless buffer when elvis dies, then
  5730.           elvrec will pretend that the file was named "foo".
  5731.  
  5732.      AUTHOR
  5733.           Steve Kirkendall
  5734.           kirkenda@cs.pdx.edu
  5735.  
  5736.  
  5737.  
  5738.  
  5739.      Page 1                                          (printed 9/23/93)
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.      FMT(1)                                                     FMT(1)
  5747.  
  5748.  
  5749.  
  5750.      NAME
  5751.           fmt - adjust line-length for paragraphs of text
  5752.  
  5753.      SYNOPSIS
  5754.           fmt [-width] [files]...
  5755.  
  5756.      DESCRIPTION
  5757.           fmt is a simple text formatter.  It inserts or deletes
  5758.           newlines, as necessary, to make all lines in a paragraph be
  5759.           approximately the same width.  It preserves indentation and
  5760.           word spacing.
  5761.  
  5762.           The default line width is 72 characters.  You can override
  5763.           this with the -width flag.  If you don't name any files on
  5764.           the command line, then fmt will read from stdin.
  5765.  
  5766.           It is typically used from within vi to adjust the line
  5767.           breaks in a single paragraph.  To do this, move the cursor
  5768.           to the top of the paragraph, type "!}fmt", and hit <Return>.
  5769.  
  5770.      AUTHOR
  5771.           Steve Kirkendall
  5772.           kirkenda@cs.pdx.edu
  5773.  
  5774.  
  5775.  
  5776.  
  5777.  
  5778.  
  5779.  
  5780.  
  5781.  
  5782.  
  5783.  
  5784.  
  5785.  
  5786.  
  5787.  
  5788.  
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798.  
  5799.  
  5800.  
  5801.  
  5802.  
  5803.  
  5804.  
  5805.      Page 1                                          (printed 9/23/93)
  5806.  
  5807.  
  5808.  
  5809.  
  5810.  
  5811.  
  5812.      REF(1)                                                     REF(1)
  5813.  
  5814.  
  5815.  
  5816.      NAME
  5817.           ref - Display a C function header
  5818.  
  5819.      SYNOPSIS
  5820.           ref [-t] [-c class]... [-f file]... tag
  5821.  
  5822.      DESCRIPTION
  5823.           ref quickly locates and displays the header of a function.
  5824.           To do this, ref looks in the "tags" file for the line that
  5825.           describes the function, and then scans the source file for
  5826.           the function.  When it locates the function, it displays an
  5827.           introductory comment (if there is one), the function's
  5828.           declaration, and the declarations of all arguments.
  5829.  
  5830.      SEARCH METHOD
  5831.           ref uses a fairly sophisticated tag look-up algorithm.  If
  5832.           you supply a filename via -f file, then elvis first scans
  5833.           the tags file for a static tag from that file.  This search
  5834.           is limited to the tags file in the current directory.
  5835.  
  5836.           If you supply a classname via -c class, then elvis searches
  5837.           for a tag from that class.  This search is not limited to
  5838.           the current directory; You can supply a list of directories
  5839.           in the environment variable TAGPATH, and ref will search
  5840.           through the "tags" file in each directory until it finds a
  5841.           tag in the desired class.
  5842.  
  5843.           If that fails, ref will then try to look up an ordinary
  5844.           global tag.  This search checks all of the directories
  5845.           listed in TAGPATH, too.
  5846.  
  5847.           If you've given the -t flag, then ref will simply output the
  5848.           tag line that it found, and then exit.  Without -t, though,
  5849.           ref will search for the tag line.  It will try to open the
  5850.           source file, which should be in the same directory as the
  5851.           tags file where the tag was discovered.  If the source file
  5852.           doesn't exist, or is unreadable, then ref will try to open a
  5853.           file called "refs" in that directory.  Either way, ref will
  5854.           try to locate the tag, and display whatever it finds.
  5855.  
  5856.      INTERACTION WITH ELVIS
  5857.           ref is used by elvis' shift-K command.  If the cursor is
  5858.           located on a word such as "splat", in the file "foo.c", then
  5859.           elvis will invoke ref with the command "ref -f foo.c splat".
  5860.  
  5861.           If elvis has been compiled with the -DEXTERNAL_TAGS flag,
  5862.           then elvis will use ref to scan the tags files.  This is
  5863.           slower than the built-in tag searching, but it allows elvis
  5864.           to access the more sophisticated tag lookup provided by ref.
  5865.           Other than that, external tags should act exactly like
  5866.           internal tags.
  5867.  
  5868.  
  5869.  
  5870.  
  5871.      Page 1                                          (printed 9/23/93)
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.      REF(1)                                                     REF(1)
  5879.  
  5880.  
  5881.  
  5882.      OPTIONS
  5883.           -t   Output tag info, instead of the function header.
  5884.  
  5885.           -f file
  5886.                The tag might be a static function in file.  You can
  5887.                use several -f flags to have ref consider static tags
  5888.                from more than one file.
  5889.  
  5890.           -c class
  5891.                The tag might be a member of class class.  You can use
  5892.                several -c flags to have ref consider tags from more
  5893.                than one class.
  5894.  
  5895.      FILES
  5896.           tags List of function names and their locations, generated
  5897.                by ctags.
  5898.  
  5899.           refs Function headers extracted from source files
  5900.                (optional).
  5901.  
  5902.      ENVIRONMENT
  5903.           TAGPATH
  5904.                List of directories to be searched.  The elements in
  5905.                the list are separated by either semicolons (for MS-
  5906.                DOS, Atari TOS, and AmigaDos), or by colons (every
  5907.                other operating system).  For each operating system,
  5908.                ref has a built-in default which is probably adequate.
  5909.  
  5910.      NOTES
  5911.           You might want to generate a "tags" file the directory that
  5912.           contains the source code for standard C library on your
  5913.           system.  If licensing restrictions prevent you from making
  5914.           the library source readable by everybody, then you can have
  5915.           ctags generate a "refs" file, and make "refs" readable by
  5916.           everybody.
  5917.  
  5918.           If your system doesn't come with the library source code,
  5919.           then perhaps you can produce something workable from the
  5920.           lint libraries.
  5921.  
  5922.      SEE ALSO
  5923.           elvis(1), ctags(1)
  5924.  
  5925.      AUTHOR
  5926.           Steve Kirkendall
  5927.           kirkenda@cs.pdx.edu
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933.  
  5934.  
  5935.  
  5936.  
  5937.      Page 2                                          (printed 9/23/93)
  5938.  
  5939.  
  5940.  
  5941.